Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ with gr.Blocks() as demo:
|
|
44 |
bot_message = "Hm, I don't see any document text, please paste in the box on the left."
|
45 |
else:
|
46 |
query_bot = query_model({"inputs": {"question": message, "context": context}})
|
47 |
-
if(len(query_bot)):
|
48 |
bot_message = query_bot['answer']
|
49 |
else:
|
50 |
bot_message = "I'm having trouble with this question, please try again."
|
|
|
44 |
bot_message = "Hm, I don't see any document text, please paste in the box on the left."
|
45 |
else:
|
46 |
query_bot = query_model({"inputs": {"question": message, "context": context}})
|
47 |
+
if(len(query_bot) and ("answer" in query_bot)):
|
48 |
bot_message = query_bot['answer']
|
49 |
else:
|
50 |
bot_message = "I'm having trouble with this question, please try again."
|