Spaces:
Runtime error
Runtime error
feat: test deepsek-r1-1,7b
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ with open("vector_db/chunks.pkl", "rb") as f:
|
|
14 |
|
15 |
ST = SentenceTransformer("BAAI/bge-large-en-v1.5")
|
16 |
|
17 |
-
model_id = "
|
18 |
bnb = BitsAndBytesConfig(
|
19 |
load_in_4bit=True,
|
20 |
bnb_4bit_use_double_quant=True,
|
@@ -42,7 +42,7 @@ def retrieve(q, k=3):
|
|
42 |
def make_prompt(q, docs):
|
43 |
return SYS + "\n\nContext:\n" + "\n".join(docs) + f"\n\nQuestion: {q}\nAnswer:"
|
44 |
|
45 |
-
@spaces.GPU
|
46 |
def qa_fn(question: str) -> str:
|
47 |
docs = retrieve(question, 10)
|
48 |
prompt = make_prompt(question, docs)[:8000]
|
|
|
14 |
|
15 |
ST = SentenceTransformer("BAAI/bge-large-en-v1.5")
|
16 |
|
17 |
+
model_id = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
18 |
bnb = BitsAndBytesConfig(
|
19 |
load_in_4bit=True,
|
20 |
bnb_4bit_use_double_quant=True,
|
|
|
42 |
def make_prompt(q, docs):
|
43 |
return SYS + "\n\nContext:\n" + "\n".join(docs) + f"\n\nQuestion: {q}\nAnswer:"
|
44 |
|
45 |
+
@spaces.GPU()
|
46 |
def qa_fn(question: str) -> str:
|
47 |
docs = retrieve(question, 10)
|
48 |
prompt = make_prompt(question, docs)[:8000]
|