mkoot007 commited on
Commit
2b53155
·
1 Parent(s): d57f246

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load the conversational pipeline with the desired model
5
+ pipe = pipeline("conversational", model="llSourcell/medllama2_7b")
6
+
7
+ def chat_with_model(input_text):
8
+ response = pipe(input_text)
9
+ return response[0]['message']['content']
10
+
11
+ iface = gr.Interface(
12
+ fn=chat_with_model,
13
+ inputs=gr.Textbox(prompt="You:"),
14
+ outputs=gr.Textbox(prompt="Bot:"),
15
+ )
16
+
17
+ iface.launch()