Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import AutoModel, AutoTokenizer | |
from transformers import TextGenerationPipeline | |
tokenizer = AutoTokenizer.from_pretrained("Sigurdur/icebreaker") | |
model = AutoModel.from_pretrained("Sigurdur/icebreaker") | |
pipeline = TextGenerationPipeline(model=model, tokenizer=tokenizer) | |
def generate_text(inp): | |
generated_text = pipeline(inp) | |
output = generated_text[0]["generated_text"] | |
return output | |
output_text = gr.outputs.Textbox() | |
gr.Interface(generate_text,"textbox",output_text,title="Text Generation machine ",description="Ask any question. Note: It can take 20-60 seconds to generate output based on your internet connection.").launch() |