MEDAPP-T1 / app.py
CAGIL DENIZCAN DURGUN
Create app.py
bc74133 verified
raw
history blame contribute delete
571 Bytes
from transformers import pipeline
import gradio as gr
# Load the medical model
pipe = pipeline("text-generation", model="Intelligent-Internet/II-Medical-8B")
def generate_response(user_input):
result = pipe(user_input, max_new_tokens=100)[0]["generated_text"]
return result
demo = gr.Interface(
fn=generate_response,
inputs=gr.Textbox(lines=2, placeholder="Ask your medical question..."),
outputs="text",
title="II-Medical-8B Medical Chat",
description="Ask any health-related question powered by the II-Medical-8B model."
)
demo.launch()