improve pbar
Browse files
app.py
CHANGED
|
@@ -50,8 +50,8 @@ sb.write(pseudo_code)
|
|
| 50 |
|
| 51 |
# train model
|
| 52 |
if sb.button("Run Example"):
|
| 53 |
-
|
| 54 |
print("Running training")
|
| 55 |
for i in range(runs):
|
| 56 |
-
|
| 57 |
-
|
|
|
|
| 50 |
|
| 51 |
# train model
|
| 52 |
if sb.button("Run Example"):
|
| 53 |
+
|
| 54 |
print("Running training")
|
| 55 |
for i in range(runs):
|
| 56 |
+
my_bar = sb.progress(0)
|
| 57 |
+
train(project=project, entity=entity, epochs=epochs, bar=my_bar)
|
utils.py
CHANGED
|
@@ -3,7 +3,7 @@ import random, time
|
|
| 3 |
import wandb
|
| 4 |
|
| 5 |
|
| 6 |
-
def train(project="st", entity=None, epochs=10):
|
| 7 |
run = wandb.init(
|
| 8 |
# Set the project where this run will be logged
|
| 9 |
project=project,
|
|
@@ -24,6 +24,7 @@ def train(project="st", entity=None, epochs=10):
|
|
| 24 |
# 2️⃣ Log metrics from your script to W&B
|
| 25 |
wandb.log({"acc": acc, "loss": loss})
|
| 26 |
time.sleep(0.1)
|
|
|
|
| 27 |
|
| 28 |
# Mark the run as finished
|
| 29 |
wandb.finish()
|
|
|
|
| 3 |
import wandb
|
| 4 |
|
| 5 |
|
| 6 |
+
def train(project="st", entity=None, epochs=10, bar=None):
|
| 7 |
run = wandb.init(
|
| 8 |
# Set the project where this run will be logged
|
| 9 |
project=project,
|
|
|
|
| 24 |
# 2️⃣ Log metrics from your script to W&B
|
| 25 |
wandb.log({"acc": acc, "loss": loss})
|
| 26 |
time.sleep(0.1)
|
| 27 |
+
bar.progress(epoch/epochs)
|
| 28 |
|
| 29 |
# Mark the run as finished
|
| 30 |
wandb.finish()
|