fix: correct OpenAI o1 model parameters
This commit is contained in:
parent
c501641c91
commit
11637c5244
@ -45,7 +45,9 @@ export function requestInference(
|
|||||||
subscriber.complete()
|
subscriber.complete()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (model.parameters?.stream === false) {
|
// There could be overriden stream parameter in the model
|
||||||
|
// that is set in request body (transformed payload)
|
||||||
|
if (requestBody?.stream === false || model.parameters?.stream === false) {
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
if (transformResponse) {
|
if (transformResponse) {
|
||||||
subscriber.next(transformResponse(data))
|
subscriber.next(transformResponse(data))
|
||||||
|
|||||||
@ -97,11 +97,9 @@
|
|||||||
"format": "api",
|
"format": "api",
|
||||||
"settings": {},
|
"settings": {},
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"max_tokens": 4096,
|
"temperature": 1,
|
||||||
"temperature": 0.7,
|
"top_p": 1,
|
||||||
"top_p": 0.95,
|
"max_tokens": 32768,
|
||||||
"stream": true,
|
|
||||||
"stop": [],
|
|
||||||
"frequency_penalty": 0,
|
"frequency_penalty": 0,
|
||||||
"presence_penalty": 0
|
"presence_penalty": 0
|
||||||
},
|
},
|
||||||
@ -125,11 +123,9 @@
|
|||||||
"format": "api",
|
"format": "api",
|
||||||
"settings": {},
|
"settings": {},
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"max_tokens": 4096,
|
"temperature": 1,
|
||||||
"temperature": 0.7,
|
"top_p": 1,
|
||||||
"top_p": 0.95,
|
"max_tokens": 65536,
|
||||||
"stream": true,
|
|
||||||
"stop": [],
|
|
||||||
"frequency_penalty": 0,
|
"frequency_penalty": 0,
|
||||||
"presence_penalty": 0
|
"presence_penalty": 0
|
||||||
},
|
},
|
||||||
|
|||||||
@ -76,11 +76,11 @@ export default class JanInferenceOpenAIExtension extends RemoteOAIEngine {
|
|||||||
transformPayload = (payload: OpenAIPayloadType): OpenAIPayloadType => {
|
transformPayload = (payload: OpenAIPayloadType): OpenAIPayloadType => {
|
||||||
// Transform the payload for preview models
|
// Transform the payload for preview models
|
||||||
if (this.previewModels.includes(payload.model)) {
|
if (this.previewModels.includes(payload.model)) {
|
||||||
const { max_tokens, temperature, top_p, stop, ...params } = payload
|
const { max_tokens, stop, ...params } = payload
|
||||||
return {
|
return {
|
||||||
...params,
|
...params,
|
||||||
max_completion_tokens: max_tokens,
|
max_completion_tokens: max_tokens,
|
||||||
stream: false // o1 only support stream = false
|
stream: false, // o1 only support stream = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Pass through for non-preview models
|
// Pass through for non-preview models
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@janhq/model-extension",
|
"name": "@janhq/model-extension",
|
||||||
"productName": "Model Management",
|
"productName": "Model Management",
|
||||||
"version": "1.0.34",
|
"version": "1.0.35",
|
||||||
"description": "Model Management Extension provides model exploration and seamless downloads",
|
"description": "Model Management Extension provides model exploration and seamless downloads",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"author": "Jan <service@jan.ai>",
|
"author": "Jan <service@jan.ai>",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user