aavetis's picture
Update app.py
a3339ce
raw
history blame
500 Bytes
import gradio as gr
from transformers import pipeline, set_seed
from transformers import BioGptTokenizer, BioGptForCausalLM
model = BioGptForCausalLM.from_pretrained("microsoft/biogpt")
tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt")
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
set_seed(42)
generator("Tirzepatide is a new drug used to treat", max_length=20, num_return_sequences=5, do_sample=True)
# gr.Interface.load("models/microsoft/biogpt").launch()