Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,15 +32,31 @@ def main(question):
|
|
32 |
answer=chat_client.predict(
|
33 |
"Howdy!",
|
34 |
"new.json",
|
35 |
-
"You are an AI language model and must return truthful responses as per the information below\n ##Input: Information: Your name is
|
36 |
0.8,
|
37 |
0.9,
|
38 |
fn_index=4
|
39 |
)
|
40 |
|
41 |
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
return answer
|
46 |
|
|
|
32 |
answer=chat_client.predict(
|
33 |
"Howdy!",
|
34 |
"new.json",
|
35 |
+
"You are an AI language model and must return truthful responses as per the information below\n ##Input: Information: Your name is Southampton GPT. You are a helpful and truthful chatbot. You can help answer any questions about the Southampton University." +information+question, # str in 'Type an input and press Enter' Textbox component
|
36 |
0.8,
|
37 |
0.9,
|
38 |
fn_index=4
|
39 |
)
|
40 |
|
41 |
|
42 |
+
|
43 |
+
try:
|
44 |
+
answer = chat_client.predict(
|
45 |
+
"Howdy!",
|
46 |
+
"new.json",
|
47 |
+
"You are an AI language model and must return truthful responses as per the information below\n ##Input: Information: Your name is IITIGPT. You are a helpful and truthful chatbot. You can help answer any questions about the IIT Indore campus." + information + question,
|
48 |
+
0.8,
|
49 |
+
0.9,
|
50 |
+
fn_index=4
|
51 |
+
)
|
52 |
+
if answer is None:
|
53 |
+
print("Chat client returned None.")
|
54 |
+
else:
|
55 |
+
print(answer)
|
56 |
+
n_conv+=1
|
57 |
+
except Exception as e:
|
58 |
+
print("Error:", str(e))
|
59 |
+
|
60 |
|
61 |
return answer
|
62 |
|