chat-ui icon indicating copy to clipboard operation
chat-ui copied to clipboard

top_k and frequency_penalty not passed to OpenAI compatible API endpoint correctly

Open davideuler opened this issue 1 year ago • 0 comments

I deployed chat-ui as a frontend for dolphin-2.6-mixtral-8x7b, CodeFuse-DeepSeek-33B GPTQ models etc. In my case text generation webui serves the model inference. I found that theses models works well in the chat page on text generation webui. But gives worse response in chat-ui front end.

I checked the verbose log in text generation webui. And finally confirmed the problems was caused by top_k and frequency_penalty not passed. I update the code in src/lib/server/endpoints/openai/endpointOai.ts, finally it works with OpenAI API exposed by text-generation-webui.

@@ -55,7 +55,8 @@ export async function endpointOai(
                                        stop: model.parameters?.stop,
                                        temperature: model.parameters?.temperature,
                                        top_p: model.parameters?.top_p,
-                                       frequency_penalty: model.parameters?.repetition_penalty,
+                                       top_k: 21,
+                                       frequency_penalty: 0,
                                })
                        );
                };
@@ -79,7 +80,8 @@ export async function endpointOai(
                                        stop: model.parameters?.stop,
                                        temperature: model.parameters?.temperature,
                                        top_p: model.parameters?.top_p,
-                                       frequency_penalty: model.parameters?.repetition_penalty,
+                                       frequency_penalty: 0,
+                                       top_k: 21,
                                })
                        );
                };

davideuler avatar Mar 02 '24 11:03 davideuler