Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
model_name = "MaziyarPanahi/Mistral-7B-Alpaca-52k-v0.2" | |
pipe = pipeline("text-generation", model=model_name) | |
def generate_text(prompt): | |
response = pipe(prompt, max_length=50) | |
return response[0]['generated_text'] | |
iface = gr.Interface(fn=generate_text, inputs="text", outputs="text") | |
iface.launch() | |