Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ example= '''{
|
|
23 |
|
24 |
def predict(instancia):
|
25 |
print(instancia)
|
26 |
-
instancia=json.loads(instancia
|
27 |
instancia_preprocesada=preprocess_item(instancia)
|
28 |
inputs={}
|
29 |
inputs['input_nodes'] = torch.tensor([instancia_preprocesada['input_nodes']])
|
@@ -38,12 +38,11 @@ def predict(instancia):
|
|
38 |
predicted_class_id = logits.argmax().item()
|
39 |
return str(logits.item())
|
40 |
|
41 |
-
ejemplos = [
|
42 |
-
{"node_feat": [[0],[0],[0],[0],[0],[0],[0],[0],[1],[0],[0],[0],[0],[1],[2],[0],[0],[0],[0],[0],[0],[3],[0],[0]],
|
43 |
"edge_index": [[0,1,1,1,1,2,3,4,4,4,5,5,6,6,7,7,7,8,8,9,9,10,10,10,11,11,12,12,12,13,14,14,15,15,15,16,16,17,17,18,18,19,19,20,20,20,21,22,22,22,23,23]],
|
44 |
"edge_attr": [[1],[1],[1],[1],[1],[1],[1],[1],[2],[1],[2],[1],[1],[2],[2],[1],[1],[1],[1],[1],[2],[2],[1],[1],[1],[1],[1],[2],[1],[2],[1],[1],[1],[2],[1],[2],[1],[1],[2],[2],[1],[1],[2],[1],[2],[1],[1],[1],[1],[2],[1],[2]],
|
45 |
"y": [3.1381945610046387],
|
46 |
-
"num_nodes": 24}
|
47 |
]
|
48 |
|
49 |
# Crear la interfaz Gradio
|
|
|
23 |
|
24 |
def predict(instancia):
|
25 |
print(instancia)
|
26 |
+
instancia=json.loads(instancia)
|
27 |
instancia_preprocesada=preprocess_item(instancia)
|
28 |
inputs={}
|
29 |
inputs['input_nodes'] = torch.tensor([instancia_preprocesada['input_nodes']])
|
|
|
38 |
predicted_class_id = logits.argmax().item()
|
39 |
return str(logits.item())
|
40 |
|
41 |
+
ejemplos = ['''{"node_feat": [[0],[0],[0],[0],[0],[0],[0],[0],[1],[0],[0],[0],[0],[1],[2],[0],[0],[0],[0],[0],[0],[3],[0],[0]],
|
|
|
42 |
"edge_index": [[0,1,1,1,1,2,3,4,4,4,5,5,6,6,7,7,7,8,8,9,9,10,10,10,11,11,12,12,12,13,14,14,15,15,15,16,16,17,17,18,18,19,19,20,20,20,21,22,22,22,23,23]],
|
43 |
"edge_attr": [[1],[1],[1],[1],[1],[1],[1],[1],[2],[1],[2],[1],[1],[2],[2],[1],[1],[1],[1],[1],[2],[2],[1],[1],[1],[1],[1],[2],[1],[2],[1],[1],[1],[2],[1],[2],[1],[1],[2],[2],[1],[1],[2],[1],[2],[1],[1],[1],[1],[2],[1],[2]],
|
44 |
"y": [3.1381945610046387],
|
45 |
+
"num_nodes": 24}'''
|
46 |
]
|
47 |
|
48 |
# Crear la interfaz Gradio
|