jayur commited on
Commit
829e0eb
·
verified ·
1 Parent(s): 6b75cdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -20,8 +20,8 @@ def lingua_stats(language:str)->str: #it's import to specify the return type
20
  from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
21
  model = HfApiModel()
22
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
23
- world_population = float(agent.run("What is the world population?"))
24
- lang_spkrs = float(agent.run(f"How many people in the speak {language}?"))
25
  lang_spkrs_pct = (lang_spkrs/world_population)*100
26
  return f"The percentage of {language} speaking population in the world is : ({str(lang_spkrs_pct)})"
27
  except Exception as e:
 
20
  from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
21
  model = HfApiModel()
22
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
23
+ world_population = float(agent.run("What is the world population as a float?"))
24
+ lang_spkrs = float(agent.run(f"How many people in the speak {language} as a float?"))
25
  lang_spkrs_pct = (lang_spkrs/world_population)*100
26
  return f"The percentage of {language} speaking population in the world is : ({str(lang_spkrs_pct)})"
27
  except Exception as e: