Spaces:
Build error
Build error
app.py
CHANGED
@@ -82,15 +82,10 @@ def lang_model_response(prompt):
|
|
82 |
response = requests.post(API_URL, headers=headers, json=json_)
|
83 |
print(f"Response is : {response}")
|
84 |
output = response.json()
|
85 |
-
print(f"output is : {output}")
|
86 |
output_tmp = output[0]['generated_text']
|
87 |
print(f"output_tmp is: {output_tmp}")
|
88 |
-
|
89 |
-
# solution = output_tmp.split("?")[1]
|
90 |
-
#elif '.' in prompt:
|
91 |
-
# solution = output_tmp.split(".")[1]
|
92 |
-
#else:
|
93 |
-
solution = output_tmp.split("Answer:")[2]
|
94 |
|
95 |
print(f"Final response after splits is: {solution}")
|
96 |
return solution
|
|
|
82 |
response = requests.post(API_URL, headers=headers, json=json_)
|
83 |
print(f"Response is : {response}")
|
84 |
output = response.json()
|
85 |
+
#print(f"output is : {output}")
|
86 |
output_tmp = output[0]['generated_text']
|
87 |
print(f"output_tmp is: {output_tmp}")
|
88 |
+
solution = output_tmp.split("Answer: ")[2].split("\n")[0]
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
print(f"Final response after splits is: {solution}")
|
91 |
return solution
|