Documentation ¶
Index ¶
- Constants
- type ConsoleReporter
- type ContentTest
- func (ct *ContentTest) CoerceContentTest(other *ContentTest)
- func (ct *ContentTest) CreateConsoleReporter() (ur ConsoleReporter)
- func (ct ContentTest) CreateTextReporter(path string) (textReporter TextReporter)
- func (ct ContentTest) FieldsSame(fields []string, other ContentTest) bool
- func (ct ContentTest) GeneratePermutations() (tests []ContentTest)
- func (ct ContentTest) GeneratePermutationsFromSpec(spec PermutationsSpec) ContentTests
- func (ct *ContentTest) GetModuleFilename() (moduleFile string)
- func (ct *ContentTest) GetPrefixName() (prefixName string)
- func (ct *ContentTest) MakeLabel(spec PermutationsSpec) (label string)
- func (ct ContentTest) MakeReporters() Reporters
- func (ct ContentTest) Perform()
- type ContentTests
- type EncodedIterationResult
- type IterationResult
- type JSONReporter
- type PermutationsSpec
- type PlaceholderMap
- type Reporters
- type RequestContext
- type TextReporter
Constants ¶
View Source
const MaxFileExtensionLength = 5
View Source
const MaxFilePathLength = 210
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleReporter ¶
type ConsoleReporter struct {
// contains filtered or unexported fields
}
func (*ConsoleReporter) ReportGeneration ¶
func (cr *ConsoleReporter) ReportGeneration(resp string)
func (*ConsoleReporter) ReportIteration ¶
func (cr *ConsoleReporter) ReportIteration(iteration int)
type ContentTest ¶
type ContentTest struct { Index int `json:-` OutputPrefix string `json:"output_prefix"` PromptFilename string `json:"prompt_filename"` ScenarioFilename string `json:"scenario_filename"` ModuleFilename string `json:"module_filename"` Prompt string `json:"prompt"` Memory string `json:"memory"` AuthorsNote string `json:"authors_note"` MaxTokens *int `json:"max_tokens"` Iterations *int `json:"iterations"` Generations *int `json:"generations"` Parameters novelai_api.NaiGenerateParams `json:"parameters"` Permutations []PermutationsSpec `json:"permutations"` Placeholders PlaceholderMap `json:"placeholders"` WorkingDir string PromptPath string ScenarioPath string ModulePath string Scenario *scenario.Scenario AIModule *aimodules.AIModule API novelai_api.NovelAiAPI }
func GenerateTestsFromFile ¶
func GenerateTestsFromFile(path string) (tests []ContentTest)
func LoadSpecFromFile ¶
func LoadSpecFromFile(path string) (test ContentTest)
func MakeDefaultContentTest ¶
func MakeDefaultContentTest() (ct ContentTest)
func MakeTestFromScenario ¶
func MakeTestFromScenario(path string) (test ContentTest)
func (*ContentTest) CoerceContentTest ¶
func (ct *ContentTest) CoerceContentTest(other *ContentTest)
func (*ContentTest) CreateConsoleReporter ¶
func (ct *ContentTest) CreateConsoleReporter() (ur ConsoleReporter)
func (ContentTest) CreateTextReporter ¶
func (ct ContentTest) CreateTextReporter(path string) (textReporter TextReporter)
func (ContentTest) FieldsSame ¶
func (ct ContentTest) FieldsSame(fields []string, other ContentTest) bool
func (ContentTest) GeneratePermutations ¶
func (ct ContentTest) GeneratePermutations() (tests []ContentTest)
func (ContentTest) GeneratePermutationsFromSpec ¶
func (ct ContentTest) GeneratePermutationsFromSpec(spec PermutationsSpec) ContentTests
func (*ContentTest) GetModuleFilename ¶
func (ct *ContentTest) GetModuleFilename() (moduleFile string)
func (*ContentTest) GetPrefixName ¶
func (ct *ContentTest) GetPrefixName() (prefixName string)
func (*ContentTest) MakeLabel ¶
func (ct *ContentTest) MakeLabel(spec PermutationsSpec) (label string)
func (ContentTest) MakeReporters ¶
func (ct ContentTest) MakeReporters() Reporters
func (ContentTest) Perform ¶
func (ct ContentTest) Perform()
type ContentTests ¶
type ContentTests []ContentTest
type EncodedIterationResult ¶
type EncodedIterationResult struct { Prompt string `json:"prompt"` Memory string `json:"memory"` AuthorsNote string `json:"authors_note"` Requests []RequestContext `json:"requests"` }
type IterationResult ¶
type IterationResult struct { Parameters novelai_api.NaiGenerateParams `json:"settings"` Prompt string `json:"prompt"` Memory string `json:"memory"` AuthorsNote string `json:"authors_note"` Result string `json:"result"` Responses []string `json:"responses"` ContextReport scenario.ContextReport `json:"context_report"` Encoded EncodedIterationResult `json:"encoded"` }
type JSONReporter ¶
type JSONReporter struct {
// contains filtered or unexported fields
}
func CreateJSONReporter ¶
func CreateJSONReporter(path string) (reportWriter JSONReporter)
func (*JSONReporter) SerializeIteration ¶
func (reportWriter *JSONReporter) SerializeIteration(result *IterationResult)
type PermutationsSpec ¶
type PermutationsSpec struct { Model []string `json:"model"` Prefix []*string `json:"prefix"` ModuleFilename []*string `json:"module_filename"` PromptFilename []*string `json:"prompt_filename"` Prompt []*string `json:"prompt"` Memory []*string `json:"memory"` AuthorsNote []*string `json:"authors_note"` Placeholders []*PlaceholderMap `json:"placeholders"` Temperature []*float64 `json:"temperature"` MaxLength []*uint `json:"max_length"` MinLength []*uint `json:"min_length"` TopK []*uint `json:"top_k"` TopP []*float64 `json:"top_p"` TopA []*float64 `json:"top_a"` TailFreeSampling []*float64 `json:"tail_free_sampling"` RepetitionPenalty []*float64 `json:"repetition_penalty"` RepetitionPenaltyRange []*uint `json:"repetition_penalty_range"` RepetitionPenaltySlope []*float64 `json:"repetition_penalty_slope"` RepetitionPenaltyFrequency []*float64 `json:"repetition_penalty_frequency"` RepetitionPenaltyPresence []*float64 `json:"repetition_penalty_presence"` Order []*novelai_api.LogitProcessorIDs `json:"order"` }
type PlaceholderMap ¶
type Reporters ¶
type Reporters struct { JSON *JSONReporter Text *TextReporter Console *ConsoleReporter }
func (Reporters) ReportGeneration ¶
func (Reporters) ReportIteration ¶
func (Reporters) SerializeIteration ¶
func (reporters Reporters) SerializeIteration(result *IterationResult)
type RequestContext ¶
type RequestContext struct { Request novelai_api.NaiGenerateResp `json:"requests"` ContextReport scenario.ContextReport `json:"context_report"` }
type TextReporter ¶
type TextReporter struct {
// contains filtered or unexported fields
}
func (*TextReporter) ReportGeneration ¶
func (tr *TextReporter) ReportGeneration(resp string)
func (*TextReporter) ReportIteration ¶
func (tr *TextReporter) ReportIteration(iteration int)
Click to show internal directories.
Click to hide internal directories.