Spaces:
Runtime error
Runtime error
desarrolloasesoreslocales
commited on
Commit
·
d30c3fd
1
Parent(s):
5c3bdbe
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ id2label = {0: "World", 1: "Sports", 2: "Business", 3: "Sci/Tech"}
|
|
11 |
def predict(payload):
|
12 |
results = model.predict_proba([payload])[0]
|
13 |
|
14 |
-
return [
|
15 |
|
16 |
# Crear una interfaz Gradio
|
17 |
iface = gr.Interface(
|
|
|
11 |
def predict(payload):
|
12 |
results = model.predict_proba([payload])[0]
|
13 |
|
14 |
+
return "\n".join([f"Label: {id2label[i]}, Score: {result.item()}" for i, result in enumerate(results)])
|
15 |
|
16 |
# Crear una interfaz Gradio
|
17 |
iface = gr.Interface(
|