Spaces:
Runtime error
Runtime error
Download app.py from therehack31/ia_rehack: direct link, hf CLI and curl.
- Browser
- Download file 499 Bytes
-
https://huggingface.co/spaces/therehack31/ia_rehack/resolve/main/app.py
- Command line
-
hf download hf://spaces/therehack31/ia_rehack/app.py
-
curl -L -o app.py https://huggingface.co/spaces/therehack31/ia_rehack/resolve/main/app.py
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() |