CAGIL DENIZCAN DURGUN commited on
Commit
bc74133
·
verified ·
1 Parent(s): 55d04e4

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ # Load the medical model
5
+ pipe = pipeline("text-generation", model="Intelligent-Internet/II-Medical-8B")
6
+
7
+ def generate_response(user_input):
8
+ result = pipe(user_input, max_new_tokens=100)[0]["generated_text"]
9
+ return result
10
+
11
+ demo = gr.Interface(
12
+ fn=generate_response,
13
+ inputs=gr.Textbox(lines=2, placeholder="Ask your medical question..."),
14
+ outputs="text",
15
+ title="II-Medical-8B Medical Chat",
16
+ description="Ask any health-related question powered by the II-Medical-8B model."
17
+ )
18
+
19
+ demo.launch()