ysharma HF staff commited on
Commit
2719319
1 Parent(s): c9f7d28
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -139,9 +139,12 @@ def lang_model_response(prompt, language):
139
  output = response.json()
140
  output_tmp = output[0]['generated_text']
141
  print(f"Bloom API Response is : {output_tmp}")
142
- #if language == 'en':
143
- solution = output_tmp.split("Answer: ")[2].split("\n")[0]
144
- #else:
 
 
 
145
  # solution = output_tmp.split(".")[1]
146
  print(f"Final Bloom Response after splits is: {solution}")
147
  return solution
 
139
  output = response.json()
140
  output_tmp = output[0]['generated_text']
141
  print(f"Bloom API Response is : {output_tmp}")
142
+ if language == 'en':
143
+ solution = output_tmp.split("Answer: ")[2].split("\n")[0]
144
+ elif language == 'es':
145
+ solution = output_tmp.split("Responder: ")[2].split("\n")[0]
146
+ elif language == 'fr':
147
+ solution = output_tmp.split("Réponse: ")[2].split("\n")[0]
148
  # solution = output_tmp.split(".")[1]
149
  print(f"Final Bloom Response after splits is: {solution}")
150
  return solution