Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 as a
|
24 |
-
lang_spkrs = float(agent.run(f"How many people in the world speak {language} as a float?"))
|
25 |
print(world_population, lang_spkrs)
|
26 |
lang_spkrs_pct = (lang_spkrs/world_population)*100
|
27 |
return f"The percentage of {language} speaking population in the world is %3.3f: ({str(lang_spkrs_pct)})"
|
|
|
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? Provide the answer as a single number"))
|
24 |
+
lang_spkrs = float(agent.run(f"How many people in the world speak {language} as a float? Provide the answer as a single number"))
|
25 |
print(world_population, lang_spkrs)
|
26 |
lang_spkrs_pct = (lang_spkrs/world_population)*100
|
27 |
return f"The percentage of {language} speaking population in the world is %3.3f: ({str(lang_spkrs_pct)})"
|