Spaces:
Runtime error
Runtime error
Manuel Calzolari
commited on
Commit
•
3b39107
1
Parent(s):
eaf24ca
Add check
Browse files
app.py
CHANGED
@@ -107,6 +107,8 @@ rag_chain = (
|
|
107 |
)
|
108 |
|
109 |
def get_answer(question):
|
|
|
|
|
110 |
try:
|
111 |
# Submit the question to the pipeline and extract the output
|
112 |
answer = rag_chain.invoke(question).split("Output:")[1].strip()
|
|
|
107 |
)
|
108 |
|
109 |
def get_answer(question):
|
110 |
+
if not question.strip():
|
111 |
+
return "Please enter a question."
|
112 |
try:
|
113 |
# Submit the question to the pipeline and extract the output
|
114 |
answer = rag_chain.invoke(question).split("Output:")[1].strip()
|