Update app.py
Browse files
app.py
CHANGED
@@ -14,14 +14,6 @@ except ImportError:
|
|
14 |
print('todo en orden')
|
15 |
model = GraphormerForGraphClassification.from_pretrained("PedroLancharesSanchez/graph-regression")
|
16 |
|
17 |
-
example= '''{
|
18 |
-
"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]],
|
19 |
-
"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],[1,0,2,3,4,1,1,1,5,23,4,6,5,7,6,8,22,7,9,8,10,9,11,22,10,12,11,13,14,12,12,15,14,16,20,15,17,16,18,17,19,18,20,15,19,21,20,7,10,23,4,22]],
|
20 |
-
"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]],
|
21 |
-
"y": [3.1381945610046387],
|
22 |
-
"num_nodes": 24
|
23 |
-
}'''
|
24 |
-
|
25 |
def predict(instancia):
|
26 |
print(instancia)
|
27 |
instancia=json.loads(instancia)
|
@@ -45,7 +37,6 @@ ejemplos = '''{"node_feat": [[0],[0],[0],[0],[0],[0],[0],[0],[1],[0],[0],[0],[0]
|
|
45 |
"y": [3.1381945610046387],
|
46 |
"num_nodes": 24}'''
|
47 |
|
48 |
-
|
49 |
# Crear la interfaz Gradio
|
50 |
-
interfaz = gr.Interface(fn=predict, inputs="text", outputs='text', examples=
|
51 |
interfaz.launch(share=False)
|
|
|
14 |
print('todo en orden')
|
15 |
model = GraphormerForGraphClassification.from_pretrained("PedroLancharesSanchez/graph-regression")
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
def predict(instancia):
|
18 |
print(instancia)
|
19 |
instancia=json.loads(instancia)
|
|
|
37 |
"y": [3.1381945610046387],
|
38 |
"num_nodes": 24}'''
|
39 |
|
|
|
40 |
# Crear la interfaz Gradio
|
41 |
+
interfaz = gr.Interface(fn=predict, inputs="text", outputs='text', examples=['grafo1.json'])
|
42 |
interfaz.launch(share=False)
|