Spaces:
Runtime error
Runtime error
Commit
·
c7443d0
1
Parent(s):
f5e55a8
Modify error message if no response
Browse files
app.py
CHANGED
@@ -15,14 +15,15 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
15 |
|
16 |
def get_response_from_chatbot(text):
|
17 |
try:
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
# logger.info(f"response_: {response}")
|
24 |
except:
|
25 |
-
|
26 |
return response
|
27 |
|
28 |
def chat(message, chat_history):
|
|
|
15 |
|
16 |
def get_response_from_chatbot(text):
|
17 |
try:
|
18 |
+
print("Testing indentation")
|
19 |
+
api = ChatGPT(session_token)
|
20 |
+
resp = api.send_message(text)
|
21 |
+
api.refresh_auth()
|
22 |
+
api.reset_conversation()
|
23 |
+
response = resp['message']
|
24 |
# logger.info(f"response_: {response}")
|
25 |
except:
|
26 |
+
response = "Sorry, I'm tired. Please try again in some time"
|
27 |
return response
|
28 |
|
29 |
def chat(message, chat_history):
|