aforss commited on
Commit
0053292
1 Parent(s): 2998c61

initial commit

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load the model
5
+ model = pipeline("text-generation", model="AdaptLLM/finance-chat")
6
+
7
+ def generate_response(query):
8
+ response = model(query, max_length=100)
9
+ return response[0]['generated_text']
10
+
11
+ # Create Gradio interface
12
+ iface = gr.Interface(
13
+ fn=generate_response,
14
+ inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your query here..."),
15
+ outputs="text",
16
+ title="Finance Chat"
17
+ )
18
+
19
+ iface.launch()