Skip to content

Commit

Permalink
refactor: rename ConfigLoader and ModelLoader files, update imports, …
Browse files Browse the repository at this point in the history
…and adjust ChatsConfig structure
  • Loading branch information
Sma1lboy committed Dec 15, 2024
1 parent eb55281 commit 9c34f08
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import * as fs from 'fs';
import * as path from 'path';
import _ from 'lodash';
export interface ChatsConfig {
chats: ChatConfig[];
}
export interface ChatConfig {
model: string;
endpoint?: string;
token?: string;
default?: boolean;
task?: string;
}

export class ConfigLoader {
private chatsConfig: ChatsConfig;
private chatsConfig: ChatConfig[];

private readonly configPath: string;

Expand Down
2 changes: 1 addition & 1 deletion backend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import 'reflect-metadata';
import { downloadAllModels } from './model/ModelLoader';
import { downloadAllModels } from './model/utils';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
Expand Down
6 changes: 3 additions & 3 deletions backend/src/model/__tests__/loadAllChatsModels.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConfigLoader } from '../../config/ConfigLoader';
import { ModelDownloader } from '../ModelDownloader';
import { downloadAllModels } from '../ModelLoader';
import { ConfigLoader } from '../../config/config-loader';
import { ModelDownloader } from '../model-downloader';
import { downloadAllModels } from '../utils';

const originalIsArray = Array.isArray;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChatConfig, ConfigLoader } from 'src/config/ConfigLoader';
import { ModelDownloader } from './ModelDownloader';
import { ChatConfig, ConfigLoader } from 'src/config/config-loader';
import { ModelDownloader } from './model-downloader';

export async function downloadAllModels(): Promise<void> {
const configLoader = new ConfigLoader();
Expand Down

0 comments on commit 9c34f08

Please sign in to comment.