|
import os |
|
import gradio as gr |
|
from huggingface_hub import Agent |
|
|
|
|
|
agent = Agent( |
|
model="Qwen/Qwen2.5-72B-Instruct", |
|
provider="nebius", |
|
servers=[ |
|
{ |
|
"command": "npx", |
|
"args": [ |
|
"mcp-remote", |
|
"http://amiel-mcp-sentiment-3.hf.space/gradio_api/mcp/sse" |
|
] |
|
} |
|
], |
|
) |
|
|
|
|
|
def interact_with_agent(input_text): |
|
|
|
|
|
return f"Processed: {input_text}" |
|
|
|
|
|
demo = gr.Interface( |
|
fn=interact_with_agent, |
|
inputs="text", |
|
outputs="text", |
|
title="Agent Interaction", |
|
description="Enter text to interact with the agent." |
|
) |
|
|
|
|
|
if __name__ == "__main__": |
|
demo.launch() |