Spaces:
Sleeping
Sleeping
Commit ·
3674a23
1
Parent(s): c0c0f5a
debug
Browse files
app.py
CHANGED
|
@@ -181,7 +181,7 @@ def answer(system: str, context: str, question: str,
|
|
| 181 |
|
| 182 |
# --- generate ------------------------------------------------------
|
| 183 |
output = chat_model.generate(
|
| 184 |
-
|
| 185 |
max_new_tokens=512,
|
| 186 |
max_length=MAX_PROMPT_TOKENS + 512,
|
| 187 |
do_sample=True,
|
|
@@ -190,7 +190,7 @@ def answer(system: str, context: str, question: str,
|
|
| 190 |
top_k=top_k_tok
|
| 191 |
)
|
| 192 |
full = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 193 |
-
reply = full.split("<|im_start|>assistant")[-1].strip()
|
| 194 |
return reply
|
| 195 |
|
| 196 |
except Exception as e:
|
|
|
|
| 181 |
|
| 182 |
# --- generate ------------------------------------------------------
|
| 183 |
output = chat_model.generate(
|
| 184 |
+
prompt,
|
| 185 |
max_new_tokens=512,
|
| 186 |
max_length=MAX_PROMPT_TOKENS + 512,
|
| 187 |
do_sample=True,
|
|
|
|
| 190 |
top_k=top_k_tok
|
| 191 |
)
|
| 192 |
full = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 193 |
+
reply = full.split("<|im_start|>assistant")[-1].strip()
|
| 194 |
return reply
|
| 195 |
|
| 196 |
except Exception as e:
|