Spaces:
Runtime error
Runtime error
Michael S. Trusov commited on
Commit ·
edcbbc9
1
Parent(s): 012b1e7
October 2 commit to Hugging Face
Browse files
app.py
CHANGED
|
@@ -90,9 +90,10 @@ with gr.Blocks(theme = theme) as demo:
|
|
| 90 |
#}
|
| 91 |
|
| 92 |
with gr.Row(equal_height=True):
|
| 93 |
-
|
| 94 |
#msg = gr.Textbox(value="Pre-filled value", show_label=False, placeholder="Message ChatGPT...", max_lines=5, container=False, interactive=False)
|
| 95 |
-
|
|
|
|
| 96 |
|
| 97 |
|
| 98 |
|
|
@@ -167,12 +168,13 @@ with gr.Blocks(theme = theme) as demo:
|
|
| 167 |
if search_keyword == "None":
|
| 168 |
#bot_message = "Sorry, don't know any restaurants at this location..." + " [DEBUG (params: " + url_params + ")]"
|
| 169 |
bot_message = "Sorry, don't know any restaurants at this location..."
|
|
|
|
| 170 |
else:
|
| 171 |
output_text = qs.get(search_keyword, "Keyword identified. No information found.")
|
| 172 |
bot_message = output_text
|
| 173 |
|
| 174 |
if text == "debug":
|
| 175 |
-
bot_message = "[DEBUG (ver.
|
| 176 |
|
| 177 |
|
| 178 |
# initialize new entry
|
|
@@ -203,15 +205,15 @@ with gr.Blocks(theme = theme) as demo:
|
|
| 203 |
|
| 204 |
# Events handling
|
| 205 |
|
| 206 |
-
# btn.click(user, [msg, chatbot], [msg, chatbot], queue=False, show_progress=False).then(
|
| 207 |
-
# bot, [chatbot, url_params, session_id], chatbot, concurrency_limit=50
|
| 208 |
-
# )
|
| 209 |
-
|
| 210 |
btn.click(user, [msg, chatbot], [msg, chatbot], queue=False, show_progress=False).then(
|
| 211 |
bot, [chatbot, url_params, session_id], chatbot, concurrency_limit=50
|
| 212 |
-
).then(
|
| 213 |
-
lambda: "what's the best mexican food in Tucson", None, msg
|
| 214 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
|
| 216 |
|
| 217 |
|
|
|
|
| 90 |
#}
|
| 91 |
|
| 92 |
with gr.Row(equal_height=True):
|
| 93 |
+
msg = gr.Textbox(show_label=False, placeholder="Message ChatGPT...", max_lines = 5,container = False,)
|
| 94 |
#msg = gr.Textbox(value="Pre-filled value", show_label=False, placeholder="Message ChatGPT...", max_lines=5, container=False, interactive=False)
|
| 95 |
+
# USE FOR NOT EDITABLE VERSION
|
| 96 |
+
#msg = gr.Textbox(value="what's the best mexican food in Tucson", show_label=False, placeholder="what's the best mexican food in Tucson", max_lines = 5,container = False, interactive=False)
|
| 97 |
|
| 98 |
|
| 99 |
|
|
|
|
| 168 |
if search_keyword == "None":
|
| 169 |
#bot_message = "Sorry, don't know any restaurants at this location..." + " [DEBUG (params: " + url_params + ")]"
|
| 170 |
bot_message = "Sorry, don't know any restaurants at this location..."
|
| 171 |
+
bot_message = "I'm sorry, but I can only provide information about restaurants in Tucson at the moment. Let me know if you'd like recommendations!"
|
| 172 |
else:
|
| 173 |
output_text = qs.get(search_keyword, "Keyword identified. No information found.")
|
| 174 |
bot_message = output_text
|
| 175 |
|
| 176 |
if text == "debug":
|
| 177 |
+
bot_message = "[DEBUG (ver. 10/02/2024) params: " + url_params + "\nSentences Delay=" + str(DelayBetweenSentences) + " sec. Words Delay=" + str(DelayBetweenWords) + " sec. Letters Delay=" + str(DelayBetweenLetters) + " sec.) \nKeys:\n" + "\n".join(keywords) + "]"
|
| 178 |
|
| 179 |
|
| 180 |
# initialize new entry
|
|
|
|
| 205 |
|
| 206 |
# Events handling
|
| 207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
btn.click(user, [msg, chatbot], [msg, chatbot], queue=False, show_progress=False).then(
|
| 209 |
bot, [chatbot, url_params, session_id], chatbot, concurrency_limit=50
|
|
|
|
|
|
|
| 210 |
)
|
| 211 |
+
|
| 212 |
+
# btn.click(user, [msg, chatbot], [msg, chatbot], queue=False, show_progress=False).then(
|
| 213 |
+
# bot, [chatbot, url_params, session_id], chatbot, concurrency_limit=50
|
| 214 |
+
# ).then(
|
| 215 |
+
# lambda: "what's the best mexican food in Tucson", None, msg
|
| 216 |
+
# )
|
| 217 |
|
| 218 |
|
| 219 |
|