ReputAgent's picture
Update app.py
29adc5c verified
raw
history blame contribute delete
661 Bytes
import gradio as gr
from transformers import pipeline
generator = pipeline("text-generation", model="Qwen/Qwen2.5-0.5B-Instruct", device=-1)
def respond(message):
messages = [
{"role": "system", "content": "You are a business negotiation agent. Be direct, strategic, and professional."},
{"role": "user", "content": message},
]
result = generator(messages, max_new_tokens=256, do_sample=True, temperature=0.7)
return result[0]["generated_text"][-1]["content"]
demo = gr.Interface(
fn=respond,
inputs=gr.Textbox(label="Message"),
outputs=gr.Textbox(label="Response"),
title="Negotiation Agent",
)
demo.launch()