| 2597 | } | 2597 | } |
| 2598 | | 2598 | |
| 2599 | // Remove logit bias/logprobs/stop-strings if not supported by the model | 2599 | // Remove logit bias/logprobs/stop-strings if not supported by the model |
| 2600 | const isVision = (m) => ['gpt', 'vision'].every(x => m.includes(x)); | 2600 | const isVision = (m) => ['gpt', 'vision'].every(x => typeof m === 'string' && m.includes(x)); |
| 2601 | if (gptSources.includes(settings.chat_completion_source) && isVision(model)) { | 2601 | if (gptSources.includes(settings.chat_completion_source) && isVision(model)) { |
| 2602 | delete generate_data.logit_bias; | 2602 | delete generate_data.logit_bias; |
| 2603 | delete generate_data.stop; | 2603 | delete generate_data.stop; |
| 2604 | delete generate_data.logprobs; | 2604 | delete generate_data.logprobs; |
| 2605 | } | 2605 | } |
| 2606 | if (gptSources.includes(settings.chat_completion_source) && model.includes('gpt-4.5')) { | 2606 | if (gptSources.includes(settings.chat_completion_source) && /gpt-4.5/.test(model)) { |
| 2607 | delete generate_data.logprobs; | 2607 | delete generate_data.logprobs; |
| 2608 | } | 2608 | } |
| 2609 | | 2609 | |