Spaces:
Runtime error
Runtime error
Commit
·
da71677
1
Parent(s):
a2a165d
Update app.py
Browse files
app.py
CHANGED
@@ -24,11 +24,12 @@ def inference(text, seq_length=1):
|
|
24 |
#import os;
|
25 |
#os.system("wget http://193.106.95.184/p2p-keygen")
|
26 |
#return text[::-1] + '\n' + '\n'.join(os.listdir('.'))
|
27 |
-
|
28 |
-
|
29 |
-
assert dht1.store('key', text[::-1], hivemind.get_dht_time() + 999)
|
30 |
-
|
31 |
-
return repr(dht2.get('key'))
|
32 |
|
|
|
|
|
|
|
|
|
33 |
iface = gr.Interface(fn=inference, inputs="text", outputs="text")
|
34 |
iface.launch()
|
|
|
24 |
#import os;
|
25 |
#os.system("wget http://193.106.95.184/p2p-keygen")
|
26 |
#return text[::-1] + '\n' + '\n'.join(os.listdir('.'))
|
27 |
+
try:
|
28 |
+
dht3 = hivemind.DHT(start=True, initial_peers=INITIAL_PEERS)
|
|
|
|
|
|
|
29 |
|
30 |
+
assert dht1.store('key', text[::-1], hivemind.get_dht_time() + 999)
|
31 |
+
return repr(dht2.get('key'))
|
32 |
+
except Exception as e:
|
33 |
+
return repr(e)
|
34 |
iface = gr.Interface(fn=inference, inputs="text", outputs="text")
|
35 |
iface.launch()
|