Spaces:
Runtime error
Runtime error
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() |