palbha commited on
Commit
42a1748
·
verified ·
1 Parent(s): c7d77fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -1,9 +1,18 @@
1
  import gradio as gr
2
- from smolagents import Agent # adjust the import to your actual smolagents module
3
 
4
- # Step 1: Initialize your smolagents agent.
5
- # Replace "zephyr-7b-beta" with your desired model name/configuration.
6
- agent = Agent(model="zephyr-7b-beta")
 
 
 
 
 
 
 
 
 
7
 
8
  def respond(message, history: list[tuple[str, str]], system_message, max_tokens, temperature, top_p):
9
  """
 
1
  import gradio as gr
2
+ from smolagents import CodeAgent,HfApiModel # adjust the import to your actual smolagents module
3
 
4
+ # Step 1: Set up your smolagents agent
5
+ def create_agent():
6
+ """
7
+ Initialize and return the agent.
8
+ Adjust parameters like model type or configuration as needed.
9
+ """
10
+ # For example, we initialize an Agent with a sample model
11
+ agent = CodeAgent(tools=[], model=HfApiModel(model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud/')) # Change arguments as per your agent configuration
12
+ return agent
13
+
14
+ # Create the agent instance once so that it persists across user interactions
15
+ agent = create_agent()
16
 
17
  def respond(message, history: list[tuple[str, str]], system_message, max_tokens, temperature, top_p):
18
  """