eagle0504 commited on
Commit
de738f1
1 Parent(s): f7aad26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
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
- out = llama2_7b_ysa(prompt)
109
- engineered_prompt = f"""
110
- The user asked the question: {prompt}
111
-
112
- We have found relevant content: {out}
113
-
114
- Answer the user question based on the above content in paragraphs.
115
- """
116
- final_response = call_chatgpt(query=engineered_prompt)
 
 
 
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)