katielink's picture
Update app.py
d1725ed
raw
history blame
839 Bytes
import os
import gradio as gr
import torch
from transformers import pipeline
name_list = ['microsoft/biogpt']
examples = [['COVID-19 is'],['A 65-year-old female patient with a past medical history of']]
pipe_biogpt = pipeline("text-generation", model="microsoft/biogpt")
title = "BioGPT Demo"
description = """
Check out the [BioGPT model card](https://huggingface.co/microsoft/biogpt) for more info.
**Disclaimer:** this demo was made for research purposes only and should not be used for medical purposes.
"""
def inference(text):
output_biogpt = pipe_biogpt(text, max_length=100)[0]["generated_text"]
return [
output_biogpt,
]
io = gr.Interface(
inference,
gr.Textbox(lines=3),
outputs=[
gr.Textbox(lines=3, label="BioGPT"),
],
title=title,
description=description,
examples=examples
)
io.launch()