Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -128,6 +128,20 @@ def get_coin(id):
|
|
| 128 |
c = Blockchain.get_user_balance(id)
|
| 129 |
return c
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
with gr.Blocks() as demo:
|
| 132 |
count = 0
|
| 133 |
aa = gr.Interface(
|
|
@@ -172,6 +186,11 @@ with gr.Blocks() as demo:
|
|
| 172 |
description="add_p, id로 p2p id 추가. ok 반환. \n /run/predict_5",
|
| 173 |
)
|
| 174 |
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
|
| 177 |
demo.queue(max_size=32).launch(enable_queue=True)
|
|
|
|
| 128 |
c = Blockchain.get_user_balance(id)
|
| 129 |
return c
|
| 130 |
|
| 131 |
+
|
| 132 |
+
def get_gpus():
|
| 133 |
+
outout = []
|
| 134 |
+
for id, mem in Blockchain.user_gpus.items():
|
| 135 |
+
outout.append({"name":get_name(id),"gpu":mem})
|
| 136 |
+
return output
|
| 137 |
+
|
| 138 |
+
def get_data():
|
| 139 |
+
output = []
|
| 140 |
+
output.append({"gpus":get_gpus()})
|
| 141 |
+
output.append({"total":{"total" : Blockchain.get_total_gpu_mem, "used":38}})
|
| 142 |
+
output.append({"chain":blockchain.chain})
|
| 143 |
+
return output
|
| 144 |
+
|
| 145 |
with gr.Blocks() as demo:
|
| 146 |
count = 0
|
| 147 |
aa = gr.Interface(
|
|
|
|
| 186 |
description="add_p, id로 p2p id 추가. ok 반환. \n /run/predict_5",
|
| 187 |
)
|
| 188 |
|
| 189 |
+
gc = gr.Interface(
|
| 190 |
+
fn=get_coin,
|
| 191 |
+
inputs=["text"],
|
| 192 |
+
outputs="text",
|
| 193 |
+
description="get_coin, id로 잔여 코인(행동력) 반환. \n /run/predict_6",
|
| 194 |
+
)
|
| 195 |
|
| 196 |
demo.queue(max_size=32).launch(enable_queue=True)
|