@@ -9,7 +9,7 @@ import { OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat';
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { aiTranscriptions } from '@fastgpt/service/core/ai/audio/transcriptions';
|
||||
import { useIPFrequencyLimit } from '@fastgpt/service/common/middle/reqFrequencyLimit';
|
||||
import { getFirstSTTModel } from '@fastgpt/service/core/ai/model';
|
||||
import { getDefaultSTTModel } from '@fastgpt/service/core/ai/model';
|
||||
|
||||
const upload = getUploadModel({
|
||||
maxSize: 5
|
||||
@@ -37,7 +37,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
|
||||
filePaths = [file.path];
|
||||
|
||||
if (!getFirstSTTModel()) {
|
||||
if (!getDefaultSTTModel()) {
|
||||
throw new Error('whisper model not found');
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
// }
|
||||
|
||||
const result = await aiTranscriptions({
|
||||
model: getFirstSTTModel().model,
|
||||
model: getDefaultSTTModel().model,
|
||||
fileStream: fs.createReadStream(file.path)
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user