Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,8 @@ def lingua_stats(language:str)->str: #it's import to specify the return type
|
|
| 23 |
agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
|
| 24 |
world_population = agent.run("What is the world population?")
|
| 25 |
lang_spkrs = agent.run(f"How many people in the speak {language}?")
|
| 26 |
-
|
|
|
|
| 27 |
except Exception as e:
|
| 28 |
return f"Error: Search failed for {language}"
|
| 29 |
|
|
|
|
| 23 |
agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
|
| 24 |
world_population = agent.run("What is the world population?")
|
| 25 |
lang_spkrs = agent.run(f"How many people in the speak {language}?")
|
| 26 |
+
lang_spkrs_pct = (lang_spkrs/world_population)*100
|
| 27 |
+
return f"The percentage of {language} speaking population in the world is : ({str(lang_spkrs_pct)})"
|
| 28 |
except Exception as e:
|
| 29 |
return f"Error: Search failed for {language}"
|
| 30 |
|