crcdng commited on
Commit
c5dd005
·
1 Parent(s): 8ffc1af

error message for ran out of credits

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +9 -6
Gradio_UI.py CHANGED
@@ -247,13 +247,16 @@ class GradioUI:
247
  def interact_with_agent(self, prompt, messages):
248
  import gradio as gr
249
 
250
- messages.append(gr.ChatMessage(role="user", content=prompt))
251
- yield messages
252
- for msg in stream_to_gradio(self.agent, task=prompt, reset_agent_memory=False):
253
- messages.append(msg)
254
  yield messages
255
- yield messages
256
-
 
 
 
 
 
257
  def upload_file(
258
  self,
259
  file,
 
247
  def interact_with_agent(self, prompt, messages):
248
  import gradio as gr
249
 
250
+ try:
251
+ messages.append(gr.ChatMessage(role="user", content=prompt))
 
 
252
  yield messages
253
+ for msg in stream_to_gradio(self.agent, task=prompt, reset_agent_memory=False):
254
+ messages.append(msg)
255
+ yield messages
256
+ yield messages
257
+ except:
258
+ raise gr.Error("Due to the high demand for Your Cyberpunk Local Time Terminal, the space has run out of computing credits. The technician is notified. Please try again later. Thank you for your patience. You can sponsor the project at github.com/sponsors/crcdng")
259
+
260
  def upload_file(
261
  self,
262
  file,