实现terminalcode和文件交互
This commit is contained in:
1 parent
287e1935f6
commit
a5e5aff63f
141 files changed
+2385
-1826
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from fastapi import FastAPI
|
||||
@@ -6,11 +7,14 @@ from typing import List
|
||||
from modelscope import AutoTokenizer, AutoModel, AutoModelForCausalLM
|
||||
from transformers import BitsAndBytesConfig
|
||||
|
||||
# 自动获取脚本所在目录作为基础路径
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
# 在 load_models() 里添加量化配置
|
||||
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
|
||||
# ===================== 模型路径 =====================
|
||||
EMBED_MODEL_PATH = "/home/admin/minor_agent/modelscope/models/Qwen/Qwen3-Embedding-0___6B"
|
||||
RERANK_MODEL_PATH = "/home/admin/minor_agent/modelscope/models/Qwen/Qwen3-Reranker-4B"
|
||||
EMBED_MODEL_PATH = os.path.join(BASE_DIR, "models", "Qwen", "Qwen3-Embedding-0___6B")
|
||||
RERANK_MODEL_PATH = os.path.join(BASE_DIR, "models", "Qwen", "Qwen3-Reranker-4B")
|
||||
|
||||
# ===================== 初始化 FastAPI =====================
|
||||
app = FastAPI(title="RAG Backend with 8-bit Qwen3 Models")
|
||||
|
||||
Reference in new issue
Block a user