seccily commited on
Commit
e429742
·
verified ·
1 Parent(s): 4772dfa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
3
  import requests
4
  import inspect
5
  import pandas as pd
 
6
  from smolagents import TransformersModel, DuckDuckGoSearchTool, CodeAgent, LiteLLMModel
7
 
8
 
@@ -40,8 +41,11 @@ class BasicAgent:
40
 
41
  def __call__(self, question: str) -> str:
42
  print(f"Agent received question (first 50 chars): {question[:50]}...")
43
- answer = self.agent.run(question)
44
- print(f"Agent returning the answer: {answer}")
 
 
 
45
  return answer
46
 
47
  def run_and_submit_all( profile: gr.OAuthProfile | None):
 
3
  import requests
4
  import inspect
5
  import pandas as pd
6
+ import time
7
  from smolagents import TransformersModel, DuckDuckGoSearchTool, CodeAgent, LiteLLMModel
8
 
9
 
 
41
 
42
  def __call__(self, question: str) -> str:
43
  print(f"Agent received question (first 50 chars): {question[:50]}...")
44
+ try:
45
+ answer = self.agent.run(question)
46
+ print(f"Agent returning the answer: {answer}")
47
+ except:
48
+ time.sleep(5)
49
  return answer
50
 
51
  def run_and_submit_all( profile: gr.OAuthProfile | None):