Fix some bugs (#101)

* fix whisper large model download url ref: #93

* remove default baseURL for openAI

* add log for conversation
This commit is contained in:
an-lee
2024-01-13 19:30:58 +08:00
committed by GitHub
parent befdc6744a
commit d6a4b24a1e
5 changed files with 7 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ export const WHISPER_MODELS_OPTIONS = [
type: "large",
name: "ggml-large.bin",
size: "3.09 GB",
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large.bin",
url: "https://huggingface.co/ggerganov/whisper.cpp/blob/main/ggml-large-v3.bin",
},
];

View File

@@ -86,7 +86,8 @@
"ttsVoice": "TTS voice",
"ttsBaseUrl": "TTS base URL",
"notFound": "Conversation not found",
"contentRequired": "Content required"
"contentRequired": "Content required",
"failedToGenerateResponse": "Failed to generate response"
},
"pronunciationAssessment": {
"pronunciationScore": "Pronunciation Score",

View File

@@ -86,7 +86,8 @@
"ttsVoice": "TTS 声音",
"ttsBaseUrl": "TTS 请求地址",
"notFound": "未找到对话",
"contentRequired": "对话内容不能为空"
"contentRequired": "对话内容不能为空",
"failedToGenerateResponse": "生成失败"
},
"pronunciationAssessment": {
"pronunciationScore": "发音得分",

View File

@@ -267,13 +267,14 @@ export class Conversation extends Model<Conversation> {
const chain = await this.chain();
let response: Generation[] = [];
await chain.call({ input: content }, [
const result = await chain.call({ input: content }, [
{
handleLLMEnd: async (output) => {
response = output.generations[0];
},
},
]);
logger.debug("LLM result:", result);
if (!response) {
throw new Error(t("models.conversation.failedToGenerateResponse"));

View File

@@ -627,8 +627,6 @@ export const LLM_PROVIDERS: { [key: string]: any } = {
openai: {
name: "OpenAI",
description: t("youNeedToSetupApiKeyBeforeUsingOpenAI"),
baseUrl:
"https://gateway.ai.cloudflare.com/v1/11d43ab275eb7e1b271ba4089ecc3864/enjoy/openai",
models: [
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo",