Spaces:
Runtime error
Runtime error
Update app.py
Browse files11245634589101112131415678import gradio as grfrom transformers import pipeline
# pick whichever model you want# MODEL_NAME = "tiiuae/Falcon-H1-7B-Instruct"MODEL_NAME = "mistralai/Mistral-7B-v0.1"# Using a public model instead of gated Mistralgenerator = pipeline("text-generation", model="tiiuae/falcon-7b-instruct")
pipe = pipeline("text-generation", model=MODEL_NAME)
def chat(prompt): result = pipe(prompt, max_new_tokens=200, do_sample=True, temperature=0.7) return result[0]["generated_text"]
demo = gr.Interface(fn=chat, inputs="text", outputs="text", title="LLM Playground")demo.launch()prompt = "Write a short poem about AI:"output = generator(prompt, max_length=100, do_sample=True)print(output[0]['generated_text'])app.py+5-12