Skip to content

Commit

Permalink
fix: fixing the layer structure of chatsconfig and relative bug in Lo…
Browse files Browse the repository at this point in the history
…ader
  • Loading branch information
NarwhalChen committed Dec 13, 2024
1 parent 3ab6bc8 commit 3fe86b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion backend/src/config/ConfigLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from 'fs';
import * as path from 'path';
import _ from 'lodash';
export interface ChatsConfig {
chats: ChatConfig[];
[key: string]: ChatConfig;
}
export interface ChatConfig {
model: string;
Expand All @@ -19,6 +19,7 @@ export class ConfigLoader {
constructor() {
this.configPath = path.resolve(__dirname, 'config.json');
this.loadConfig();
console.log("111" + this.chatsConfig);
}

private loadConfig() {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/model/ModelLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ModelDownloader } from './ModelDownloader';
export async function downloadAllModels(): Promise<void> {
const configLoader = new ConfigLoader();
configLoader.validateConfig();
const chats = configLoader.get<{ [key: string]: ChatConfig }>('chats');
const chats = configLoader.get<{ [key: string]: ChatConfig }>('');
const downloader = ModelDownloader.getInstance();
const loadPromises = Object.entries(chats).map(
async ([chatKey, chatConfig]: [string, ChatConfig]) => {
Expand Down

0 comments on commit 3fe86b4

Please sign in to comment.