Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
# Modelo peque帽o,
|
| 5 |
-
pipe = pipeline("text-generation", model="
|
| 6 |
|
| 7 |
def responder(prompt):
|
| 8 |
-
respuesta = pipe(prompt, max_new_tokens=
|
| 9 |
return respuesta
|
| 10 |
|
| 11 |
demo = gr.Interface(
|
| 12 |
fn=responder,
|
| 13 |
inputs=gr.Textbox(label="Escribe tu mensaje"),
|
| 14 |
outputs=gr.Textbox(label="Respuesta"),
|
| 15 |
-
title="馃 AmInside 1.0",
|
| 16 |
-
description="
|
| 17 |
)
|
| 18 |
|
| 19 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# 馃 Modelo peque帽o, seguro y funcional sin GPU
|
| 5 |
+
pipe = pipeline("text-generation", model="sshleifer/tiny-gpt2", device=-1)
|
| 6 |
|
| 7 |
def responder(prompt):
|
| 8 |
+
respuesta = pipe(prompt, max_new_tokens=60)[0]['generated_text']
|
| 9 |
return respuesta
|
| 10 |
|
| 11 |
demo = gr.Interface(
|
| 12 |
fn=responder,
|
| 13 |
inputs=gr.Textbox(label="Escribe tu mensaje"),
|
| 14 |
outputs=gr.Textbox(label="Respuesta"),
|
| 15 |
+
title="馃 AmInside 1.0 (Versi贸n segura)",
|
| 16 |
+
description="Funciona gratis con ZeroGPU o CPU basic"
|
| 17 |
)
|
| 18 |
|
| 19 |
demo.launch()
|