diff --git a/packages/service/core/ai/config/utils.ts b/packages/service/core/ai/config/utils.ts index 54cad5c2e..d303bc5b4 100644 --- a/packages/service/core/ai/config/utils.ts +++ b/packages/service/core/ai/config/utils.ts @@ -31,7 +31,10 @@ import { delay } from '@fastgpt/global/common/system/utils'; export const loadSystemModels = async (init = false) => { const getProviderList = () => { const currentFileUrl = new URL(import.meta.url); - const modelsPath = path.join(path.dirname(currentFileUrl.pathname), 'provider'); + const modelsPath = path.join( + path.dirname(currentFileUrl.pathname.replace(/^\/+/, '')), + 'provider' + ); return fs.readdirSync(modelsPath) as string[]; };