ia_rehack / app.py
therehack31's picture
Create app.py
7beb238
Raw History Blame Contribute Delete
499 Bytes
from transformers import pipeline
import gradio as gr
model = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct")
def chat(message):
prompt = "Responde de forma directa y sin rodeos: " + message
result = model(
prompt,
max_new_tokens=150,
temperature=0.9
)
return result[0]["generated_text"]
gr.Interface(
fn=chat,
inputs=gr.Textbox(placeholder="Escribe lo que quieras..."),
outputs="text",
title="Mi IA"
).launch()