Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -1,11 +1,12 @@ | |
| 1 | 
             
            from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool, LiteLLMModel
         | 
| 2 | 
            -
            from transformers import pipeline
         | 
| 3 | 
             
            import datetime
         | 
| 4 | 
             
            import requests
         | 
| 5 | 
             
            import pytz
         | 
| 6 | 
             
            import yaml
         | 
| 7 | 
             
            import os
         | 
| 8 | 
             
            from tools.final_answer import FinalAnswerTool
         | 
|  | |
|  | |
| 9 |  | 
| 10 | 
             
            from Gradio_UI import GradioUI
         | 
| 11 |  | 
| @@ -29,6 +30,7 @@ def get_current_time_in_timezone(timezone: str) -> str: | |
| 29 |  | 
| 30 |  | 
| 31 | 
             
            final_answer = FinalAnswerTool()
         | 
|  | |
| 32 |  | 
| 33 |  | 
| 34 | 
             
            # model = HfApiModel(
         | 
| @@ -55,7 +57,7 @@ with open("prompts.yaml", 'r') as stream: | |
| 55 |  | 
| 56 | 
             
            agent = CodeAgent(
         | 
| 57 | 
             
                model=model,
         | 
| 58 | 
            -
                tools=[final_answer,  | 
| 59 | 
             
                max_steps=6,
         | 
| 60 | 
             
                verbosity_level=1,
         | 
| 61 | 
             
                grammar=None,
         | 
|  | |
| 1 | 
             
            from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool, LiteLLMModel
         | 
|  | |
| 2 | 
             
            import datetime
         | 
| 3 | 
             
            import requests
         | 
| 4 | 
             
            import pytz
         | 
| 5 | 
             
            import yaml
         | 
| 6 | 
             
            import os
         | 
| 7 | 
             
            from tools.final_answer import FinalAnswerTool
         | 
| 8 | 
            +
            from tools.polite_guard import PoliteGuardTool 
         | 
| 9 | 
            +
             | 
| 10 |  | 
| 11 | 
             
            from Gradio_UI import GradioUI
         | 
| 12 |  | 
|  | |
| 30 |  | 
| 31 |  | 
| 32 | 
             
            final_answer = FinalAnswerTool()
         | 
| 33 | 
            +
            polite_guard = PoliteGuardTool()
         | 
| 34 |  | 
| 35 |  | 
| 36 | 
             
            # model = HfApiModel(
         | 
|  | |
| 57 |  | 
| 58 | 
             
            agent = CodeAgent(
         | 
| 59 | 
             
                model=model,
         | 
| 60 | 
            +
                tools=[final_answer, polite_guard, get_current_time_in_timezone ], ## add your tools here (don't remove final answer)
         | 
| 61 | 
             
                max_steps=6,
         | 
| 62 | 
             
                verbosity_level=1,
         | 
| 63 | 
             
                grammar=None,
         | 
