kiurtis commited on
Commit
8965fc9
·
1 Parent(s): 87d5467

Initial commit

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -1,7 +1,8 @@
1
  import os
2
-
3
  from huggingface_hub import Agent
4
 
 
5
  agent = Agent(
6
  model="Qwen/Qwen2.5-72B-Instruct",
7
  provider="nebius",
@@ -14,4 +15,23 @@ agent = Agent(
14
  ]
15
  }
16
  ],
17
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import os
2
+ import gradio as gr
3
  from huggingface_hub import Agent
4
 
5
+ # Initialize the agent with the specified model and server configuration
6
  agent = Agent(
7
  model="Qwen/Qwen2.5-72B-Instruct",
8
  provider="nebius",
 
15
  ]
16
  }
17
  ],
18
+ )
19
+
20
+ # Define a function to interact with the agent
21
+ def interact_with_agent(input_text):
22
+ # Here, you would typically call the agent's method to process the input_text
23
+ # For demonstration, we'll just return a placeholder response
24
+ return f"Processed: {input_text}"
25
+
26
+ # Create a Gradio interface for the agent
27
+ demo = gr.Interface(
28
+ fn=interact_with_agent,
29
+ inputs="text",
30
+ outputs="text",
31
+ title="Agent Interaction",
32
+ description="Enter text to interact with the agent."
33
+ )
34
+
35
+ # Launch the Gradio interface
36
+ if __name__ == "__main__":
37
+ demo.launch()