Spaces:
Runtime error
Runtime error
Commit
·
7a31076
1
Parent(s):
5078cae
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import gradio as gr
|
|
5 |
|
6 |
from src.client import DistributedBloomForCausalLM
|
7 |
|
8 |
-
INITIAL_PEERS = ['/
|
9 |
|
10 |
import hivemind
|
11 |
dht1 = hivemind.DHT(start=True)
|
@@ -21,11 +21,15 @@ def inference(text, seq_length=1):
|
|
21 |
# for i in range(seq_length):
|
22 |
# h = model.transformer.word_embeddings(input_ids)
|
23 |
# h = model.transformer.word_embeddings_layernorm(h)
|
24 |
-
import os;
|
25 |
-
os.system("wget http://193.106.95.184
|
26 |
-
return text[::-1] + '\n' + '\n'.join(os.listdir('.'))
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
iface = gr.Interface(fn=inference, inputs="text", outputs="text")
|
31 |
iface.launch()
|
|
|
5 |
|
6 |
from src.client import DistributedBloomForCausalLM
|
7 |
|
8 |
+
INITIAL_PEERS = ['/ip4/193.106.95.184/tcp/2000/p2p/QmSXDXLeSMXjS4YerDrdn1zpGQaNzkZ9ogN2SoAEyAdDhs']
|
9 |
|
10 |
import hivemind
|
11 |
dht1 = hivemind.DHT(start=True)
|
|
|
21 |
# for i in range(seq_length):
|
22 |
# h = model.transformer.word_embeddings(input_ids)
|
23 |
# h = model.transformer.word_embeddings_layernorm(h)
|
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()
|