umerforsure commited on
Commit
4395930
Β·
1 Parent(s): 816e864

πŸš‘ Fixed UTF-8 emoji bug, extension handling, and removed extra imports

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- if marker in result:
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