Spaces:
Running
Running
Commit
Β·
4395930
1
Parent(s):
816e864
π Fixed UTF-8 emoji bug, extension handling, and removed extra imports
Browse files
app.py
CHANGED
|
@@ -155,9 +155,10 @@ def ask_question(question):
|
|
| 155 |
prompt = generate_prompt(context, question)
|
| 156 |
result = reasoning_pipeline(prompt)[0]['generated_text']
|
| 157 |
|
|
|
|
|
|
|
| 158 |
for marker in ["Context:", "Question:", "Instructions:"]:
|
| 159 |
-
|
| 160 |
-
result = result.split(marker)[-1].strip()
|
| 161 |
if "." in result:
|
| 162 |
result = result.rsplit(".", 1)[0] + "."
|
| 163 |
|
|
|
|
| 155 |
prompt = generate_prompt(context, question)
|
| 156 |
result = reasoning_pipeline(prompt)[0]['generated_text']
|
| 157 |
|
| 158 |
+
if result.startswith("You are a helpful academic tutor"):
|
| 159 |
+
result = result.split("Instructions:")[-1].strip()
|
| 160 |
for marker in ["Context:", "Question:", "Instructions:"]:
|
| 161 |
+
result = result.replace(marker, "").strip()
|
|
|
|
| 162 |
if "." in result:
|
| 163 |
result = result.rsplit(".", 1)[0] + "."
|
| 164 |
|