Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,6 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 43 |
|
| 44 |
final_answer = FinalAnswerTool()
|
| 45 |
|
| 46 |
-
|
| 47 |
@tool
|
| 48 |
def get_current_stock_price(ticker_symbol: str) -> Optional[Dict[str, Any]]:
|
| 49 |
"""
|
|
@@ -84,7 +83,6 @@ def get_current_stock_price(ticker_symbol: str) -> Optional[Dict[str, Any]]:
|
|
| 84 |
return {"error": f"No quote information in chart for {ticker_symbol}."}
|
| 85 |
|
| 86 |
closes = [c for c in quote_section[0].get("close", []) if c is not None]
|
| 87 |
-
|
| 88 |
if len(closes) < 2:
|
| 89 |
return {"error": f"Not enough close‐price data for {ticker_symbol}."}
|
| 90 |
|
|
@@ -113,11 +111,9 @@ def get_current_stock_price(ticker_symbol: str) -> Optional[Dict[str, Any]]:
|
|
| 113 |
return None
|
| 114 |
|
| 115 |
|
| 116 |
-
#
|
| 117 |
final_answer = FinalAnswerTool()
|
| 118 |
|
| 119 |
-
|
| 120 |
-
|
| 121 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 122 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 123 |
|
|
@@ -147,5 +143,4 @@ agent = CodeAgent(
|
|
| 147 |
prompt_templates=prompt_templates
|
| 148 |
)
|
| 149 |
|
| 150 |
-
|
| 151 |
GradioUI(agent).launch()
|
|
|
|
| 43 |
|
| 44 |
final_answer = FinalAnswerTool()
|
| 45 |
|
|
|
|
| 46 |
@tool
|
| 47 |
def get_current_stock_price(ticker_symbol: str) -> Optional[Dict[str, Any]]:
|
| 48 |
"""
|
|
|
|
| 83 |
return {"error": f"No quote information in chart for {ticker_symbol}."}
|
| 84 |
|
| 85 |
closes = [c for c in quote_section[0].get("close", []) if c is not None]
|
|
|
|
| 86 |
if len(closes) < 2:
|
| 87 |
return {"error": f"Not enough close‐price data for {ticker_symbol}."}
|
| 88 |
|
|
|
|
| 111 |
return None
|
| 112 |
|
| 113 |
|
| 114 |
+
# Finally, SmolAgent’s final answer tool reference:
|
| 115 |
final_answer = FinalAnswerTool()
|
| 116 |
|
|
|
|
|
|
|
| 117 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 118 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 119 |
|
|
|
|
| 143 |
prompt_templates=prompt_templates
|
| 144 |
)
|
| 145 |
|
|
|
|
| 146 |
GradioUI(agent).launch()
|