wbrown / novelai-research-tool

NovelAI Research Tool and API implementations in Golang
GNU General Public License v3.0
43 stars 9 forks source link

Wrong format for the order parameter #11

Open Aedial opened 2 years ago

Aedial commented 2 years ago

When using a scenario (exported from the website without any modification), the test throws the error "Error loading scenario: Logit ID is not a string or an uint!". This error happens because the code expects settings.parameters.order to be of the format "array of (string or int)" : ["typical_p", "tfs", "top_a", "temperature", "top_p", "top_k"] But the format actually exported by the website is a bit more complex :

[
  {
    "id": "typical_p",
    "enabled": true
  },
  {
    "id": "tfs",
    "enabled": true
  },
  {
    "id": "top_a",
    "enabled": true
  },
  {
    "id": "temperature",
    "enabled": true
  },
  {
    "id": "top_p",
    "enabled": false
  },
  {
    "id": "top_k",
    "enabled": false
  }
]

The function taking care of this is "func (ids *LogitProcessorIDs) UnmarshalJSON(buf []byte) error" in api.go