File size: 465 Bytes
0053292 07116da 0053292 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import gradio as gr
from transformers import pipeline
# Load the model
model = pipeline("text-generation", model="AdaptLLM/finance-chat")
def generate_response(query):
response = model(query, max_length=100)
return response[0]['generated_text']
# Create Gradio interface
iface = gr.Interface(
fn=generate_response,
inputs=gr.Textbox(lines=2, placeholder="Enter your query here..."),
outputs="text",
title="Finance Chat"
)
iface.launch()
|