Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,14 +10,6 @@ import time
|
|
10 |
import datetime
|
11 |
import requests, json
|
12 |
|
13 |
-
from pprint import pprint
|
14 |
-
import hivemind
|
15 |
-
from petals.constants import PUBLIC_INITIAL_PEERS
|
16 |
-
from health import fetch_health_state
|
17 |
-
|
18 |
-
dht = hivemind.DHT(initial_peers=PUBLIC_INITIAL_PEERS, client_mode=True, start=True)
|
19 |
-
model_name = "quantumaikr/llama-2-70b-fb16-korean"
|
20 |
-
|
21 |
loop = asyncio.get_event_loop()
|
22 |
# Monkey patch
|
23 |
def get_types(cls_set: List[Type], component: str):
|
@@ -108,13 +100,12 @@ def get_id_from_p2p(i):
|
|
108 |
# Blockchain code
|
109 |
|
110 |
def get_peers(name):
|
111 |
-
data =
|
112 |
out = []
|
113 |
for d in data['model_reports']:
|
114 |
-
if d['name'] ==
|
115 |
for r in d['server_rows']:
|
116 |
out.append(r['peer_id'])
|
117 |
-
|
118 |
return out
|
119 |
|
120 |
with gr.Blocks() as demo:
|
|
|
10 |
import datetime
|
11 |
import requests, json
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
loop = asyncio.get_event_loop()
|
14 |
# Monkey patch
|
15 |
def get_types(cls_set: List[Type], component: str):
|
|
|
100 |
# Blockchain code
|
101 |
|
102 |
def get_peers(name):
|
103 |
+
data = requests.get("https://health.petals.dev/api/v1/state").json()
|
104 |
out = []
|
105 |
for d in data['model_reports']:
|
106 |
+
if d['name'] == "petals-team/StableBeluga2":
|
107 |
for r in d['server_rows']:
|
108 |
out.append(r['peer_id'])
|
|
|
109 |
return out
|
110 |
|
111 |
with gr.Blocks() as demo:
|