diff --git a/src/config/__init__.py b/src/config/__init__.py index 522788bd..e8476be3 100644 --- a/src/config/__init__.py +++ b/src/config/__init__.py @@ -4,7 +4,7 @@ import yaml from pathlib import Path from src.utils.logging_config import logger -with open(Path("src/static/models.yaml"), "r") as f: +with open(Path("src/static/models.yaml"), 'r', encoding='utf-8') as f: _models = yaml.safe_load(f) MODEL_NAMES = _models["MODEL_NAMES"] diff --git a/src/main.py b/src/main.py index 9266eb32..c5bea229 100644 --- a/src/main.py +++ b/src/main.py @@ -1,11 +1,13 @@ import uvicorn from dotenv import load_dotenv + +load_dotenv("src/.env") + from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from src.routers import router from src.utils.logging_config import logger -load_dotenv() app = FastAPI() app.include_router(router) diff --git a/test/data/A_Dream_of_Red_Mansions_tiny.jsonl b/test/data/A_Dream_of_Red_Mansions_tiny.jsonl new file mode 100644 index 00000000..5283f7db --- /dev/null +++ b/test/data/A_Dream_of_Red_Mansions_tiny.jsonl @@ -0,0 +1,5 @@ +{"h": "贾代善", "t": "贾源", "r": "子"} +{"h": "娄氏", "t": "贾源", "r": "重孙媳妇"} +{"h": "贾母", "t": "贾代善", "r": "妻"} +{"h": "老姨奶奶", "t": "贾代善", "r": "妾"} +{"h": "贾敏", "t": "贾代善", "r": "女"} \ No newline at end of file diff --git a/web/vite.config.js b/web/vite.config.js index 47f2337a..2c0b3e13 100644 --- a/web/vite.config.js +++ b/web/vite.config.js @@ -14,7 +14,7 @@ export default defineConfig(({ mode }) => { server: { proxy: { '^/api': { - target: env.VITE_API_URL || 'http://localhost:5000', + target: env.VITE_API_URL || 'http://localhost:5050', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') }