Spaces:

arjunanand13 commited on
Commit
b04cf81
1 Parent(s): b4efea2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -106,10 +106,14 @@ class DocumentRetrievalAndGeneration:
106
  decoded = self.llm.tokenizer.batch_decode(generated_ids)
107
  generated_response = decoded[0]
108
  match1 = re.search(r'\[/INST\](.*?)</s>', generated_response, re.DOTALL)
 
109
  match2 = re.search(r'Solution:(.*?)</s>', generated_response, re.DOTALL | re.IGNORECASE)
110
  if match1:
111
  solution_text = match1.group(1).strip()
112
  print(solution_text)
 
 
 
113
  elif match2:
114
  solution_text = match2.group(1).strip()
115
  print(solution_text)
 
106
  decoded = self.llm.tokenizer.batch_decode(generated_ids)
107
  generated_response = decoded[0]
108
  match1 = re.search(r'\[/INST\](.*?)</s>', generated_response, re.DOTALL)
109
+ match12 = re.search(r'Solution:(.*?)', solution_text, re.DOTALL)
110
  match2 = re.search(r'Solution:(.*?)</s>', generated_response, re.DOTALL | re.IGNORECASE)
111
  if match1:
112
  solution_text = match1.group(1).strip()
113
  print(solution_text)
114
+ if match12:
115
+ solution_text=match12.group(1).strip()
116
+ print(solution_text)
117
  elif match2:
118
  solution_text = match2.group(1).strip()
119
  print(solution_text)