Slycat commited on
Commit
d3a0f2d
1 Parent(s): e9b2ef0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -3
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 IITIGPT. You are a helpful and truthful chatbot. You can help answer any questions about the IIT Indore campus." +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
- n_conv+=1
43
- print(answer)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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