Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,10 @@ from transformers import pipeline
|
|
2 |
|
3 |
pipe = pipeline("text-generation", model="carlosdimare/qclase")
|
4 |
|
5 |
-
def responder(
|
6 |
-
|
7 |
-
|
|
|
8 |
|
9 |
import gradio as gr
|
10 |
gr.Interface(fn=responder, inputs="text", outputs="text").launch()
|
|
|
2 |
|
3 |
pipe = pipeline("text-generation", model="carlosdimare/qclase")
|
4 |
|
5 |
+
def responder(mensaje, historial):
|
6 |
+
prompt = f"### Instrucci贸n:\n{mensaje}\n\n### Respuesta:\n"
|
7 |
+
salida = pipe(prompt, max_new_tokens=200, do_sample=True, temperature=0.7)[0]["generated_text"]
|
8 |
+
return salida[len(prompt):]
|
9 |
|
10 |
import gradio as gr
|
11 |
gr.Interface(fn=responder, inputs="text", outputs="text").launch()
|