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()