Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -207,24 +207,42 @@ def create_miner_info(
|
|
| 207 |
badge_color = "#e74c3c" # Red
|
| 208 |
|
| 209 |
return f"""
|
| 210 |
-
<div style="
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
</div>
|
| 218 |
-
<div>
|
| 219 |
-
<p>
|
| 220 |
-
<strong>Price (as of {pred_date.date()}):</strong>
|
| 221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
{source}
|
| 223 |
</span>
|
| 224 |
</p>
|
| 225 |
-
<p><strong>Electricity rate:</strong> {elec_rate:.4f} USD/kWh</p>
|
| 226 |
-
<p><strong>Cost bucket:</strong> {region_bucket}</p>
|
| 227 |
-
<p><strong>Estimated daily elec cost:</strong> ${daily_cost:,.2f}</p>
|
| 228 |
</div>
|
| 229 |
</div>
|
| 230 |
</div>
|
|
@@ -232,6 +250,7 @@ def create_miner_info(
|
|
| 232 |
|
| 233 |
|
| 234 |
|
|
|
|
| 235 |
def create_prediction_html(result, date, window):
|
| 236 |
label = result['predicted_label']
|
| 237 |
conf = result['confidence']
|
|
@@ -313,9 +332,13 @@ def create_interface():
|
|
| 313 |
precision=2,
|
| 314 |
)
|
| 315 |
machine_release_date = gr.Textbox(
|
| 316 |
-
label="
|
| 317 |
-
value="2020-05-01",
|
| 318 |
placeholder="e.g. 2020-05-01",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 319 |
)
|
| 320 |
electricity_rate = gr.Number(
|
| 321 |
label="Electricity rate (USD/kWh)",
|
|
|
|
| 207 |
badge_color = "#e74c3c" # Red
|
| 208 |
|
| 209 |
return f"""
|
| 210 |
+
<div style="
|
| 211 |
+
background:#111111;
|
| 212 |
+
padding:20px;
|
| 213 |
+
border-radius:10px;
|
| 214 |
+
border:1px solid #333333;
|
| 215 |
+
color:#ffffff;
|
| 216 |
+
font-size:14px;
|
| 217 |
+
">
|
| 218 |
+
<h3 style="color:#F7931A; margin-top:0; margin-bottom:10px;">
|
| 219 |
+
Custom ASIC Miner
|
| 220 |
+
</h3>
|
| 221 |
+
|
| 222 |
+
<div style="display:grid; grid-template-columns:1fr 1fr; gap:15px;">
|
| 223 |
+
<div style="color:#f5f5f5;">
|
| 224 |
+
<p style="margin:4px 0;"><strong>Hashrate:</strong> {machine_hashrate:.2f} TH/s</p>
|
| 225 |
+
<p style="margin:4px 0;"><strong>Power:</strong> {machine_power:.1f} W</p>
|
| 226 |
+
<p style="margin:4px 0;"><strong>Efficiency:</strong> {machine_efficiency:.2f} W/TH</p>
|
| 227 |
</div>
|
| 228 |
+
<div style="color:#f5f5f5;">
|
| 229 |
+
<p style="margin:4px 0;">
|
| 230 |
+
<strong>Price (as of {pred_date.date()}):</strong>
|
| 231 |
+
${price:,.2f}
|
| 232 |
+
<span style="
|
| 233 |
+
background:{badge_color};
|
| 234 |
+
color:#ffffff;
|
| 235 |
+
padding:2px 8px;
|
| 236 |
+
border-radius:4px;
|
| 237 |
+
font-size:11px;
|
| 238 |
+
margin-left:6px;
|
| 239 |
+
">
|
| 240 |
{source}
|
| 241 |
</span>
|
| 242 |
</p>
|
| 243 |
+
<p style="margin:4px 0;"><strong>Electricity rate:</strong> {elec_rate:.4f} USD/kWh</p>
|
| 244 |
+
<p style="margin:4px 0;"><strong>Cost bucket:</strong> {region_bucket}</p>
|
| 245 |
+
<p style="margin:4px 0;"><strong>Estimated daily elec cost:</strong> ${daily_cost:,.2f}</p>
|
| 246 |
</div>
|
| 247 |
</div>
|
| 248 |
</div>
|
|
|
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
+
|
| 254 |
def create_prediction_html(result, date, window):
|
| 255 |
label = result['predicted_label']
|
| 256 |
conf = result['confidence']
|
|
|
|
| 332 |
precision=2,
|
| 333 |
)
|
| 334 |
machine_release_date = gr.Textbox(
|
| 335 |
+
label="Release date (YYYY-MM-DD)",
|
| 336 |
+
value="2020-05-01",
|
| 337 |
placeholder="e.g. 2020-05-01",
|
| 338 |
+
lines=1,
|
| 339 |
+
scale=1,
|
| 340 |
+
container=True,
|
| 341 |
+
show_label=True,
|
| 342 |
)
|
| 343 |
electricity_rate = gr.Number(
|
| 344 |
label="Electricity rate (USD/kWh)",
|