Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -105,15 +105,18 @@ if prompt := st.chat_input("What is up?"):
|
|
| 105 |
final_response = out[0]["summary_text"]
|
| 106 |
elif option == "Llama2 on YSA":
|
| 107 |
if prompt:
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
| 117 |
elif option == "ChatGPT":
|
| 118 |
if prompt:
|
| 119 |
out = call_chatgpt(query=prompt)
|
|
|
|
| 105 |
final_response = out[0]["summary_text"]
|
| 106 |
elif option == "Llama2 on YSA":
|
| 107 |
if prompt:
|
| 108 |
+
try:
|
| 109 |
+
out = llama2_7b_ysa(prompt)
|
| 110 |
+
engineered_prompt = f"""
|
| 111 |
+
The user asked the question: {prompt}
|
| 112 |
+
|
| 113 |
+
We have found relevant content: {out}
|
| 114 |
+
|
| 115 |
+
Answer the user question based on the above content in paragraphs.
|
| 116 |
+
"""
|
| 117 |
+
final_response = call_chatgpt(query=engineered_prompt)
|
| 118 |
+
except:
|
| 119 |
+
final_response = "Sorry, the inference endpoint is temporarily done."
|
| 120 |
elif option == "ChatGPT":
|
| 121 |
if prompt:
|
| 122 |
out = call_chatgpt(query=prompt)
|