Sulaiman8 commited on
Commit
d4d3e9c
·
verified ·
1 Parent(s): 0961cbb

Update ui/gradio_interface.py

Browse files
Files changed (1) hide show
  1. ui/gradio_interface.py +20 -1
ui/gradio_interface.py CHANGED
@@ -194,7 +194,26 @@ with gr.Blocks(title="Agentic Credit Card Recommender", css=custom_css, theme=gr
194
  card_links_section += "</div>"
195
 
196
  return top_card_md, gr.update(visible=recommendation_visible), card_table_md, gr.update(visible=df_visible), gr.update(visible=df_visible), card_names_out, card_lookup_out, query, chat_container_visible, initial_context,gr.update(value=card_links_section, visible=True), gr.update(value="### 🔗 Issuer Links", visible=True)
197
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  except Exception as e:
199
  error_message = f"Error during recommendation: {str(e)}"
200
  debug_print("ERROR", f"recommend function error: {str(e)}")
 
194
  card_links_section += "</div>"
195
 
196
  return top_card_md, gr.update(visible=recommendation_visible), card_table_md, gr.update(visible=df_visible), gr.update(visible=df_visible), card_names_out, card_lookup_out, query, chat_container_visible, initial_context,gr.update(value=card_links_section, visible=True), gr.update(value="### 🔗 Issuer Links", visible=True)
197
+
198
+ except requests.exceptions.RequestException as e:
199
+
200
+ error_message = "### Service Temporarily Unavailable\n\nSorry, the AI model server is currently offline. Please try again in a few minutes."
201
+ debug_print("ERROR", f"Connection error to vLLM server: {str(e)}")
202
+
203
+ return {
204
+ gr.update(value=error_message, visible=True),
205
+ gr.update(visible=True),
206
+ "",
207
+ gr.update(visible=False),
208
+ gr.update(visible=False),
209
+ [],
210
+ {},
211
+ "",
212
+ gr.update(visible=False),
213
+ {},
214
+ gr.update(value="", visible=False),
215
+ gr.update(visible=False)
216
+ }
217
  except Exception as e:
218
  error_message = f"Error during recommendation: {str(e)}"
219
  debug_print("ERROR", f"recommend function error: {str(e)}")