Skip to content

Commit 4b83ac4

Browse files
committed
changes
1 parent a7cd1a4 commit 4b83ac4

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

examples/transformers-integration.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# /// script
22
# dependencies = [
3-
# "trackio>=0.22.0",
3+
# "trackio>=0.21.1",
44
# "datasets>=4.4.0",
55
# "transformers[torch]>=5.0.0rc2",
66
# "huggingface_hub>=1.0.0",
@@ -15,7 +15,9 @@
1515
Trainer,
1616
TrainingArguments,
1717
)
18+
import random
1819

20+
suffix = random.randint(100000, 999999)
1921
model_name = "distilbert-base-uncased"
2022
tokenizer = AutoTokenizer.from_pretrained(model_name)
2123
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=2)
@@ -27,7 +29,7 @@
2729
dataset = Dataset.from_dict({**encodings, "labels": labels})
2830

2931
username = huggingface_hub.whoami(cache=True)["name"]
30-
hub_model_id = f"{username}/trackio-transformers-demo"
32+
hub_model_id = f"{username}/trackio-transformers-demo-{suffix}"
3133

3234
# Local Trackio logs by default; the first Hub push runs sync(sdk="static") and links the dashboard on the model card.
3335

@@ -40,7 +42,7 @@
4042
learning_rate=2e-5,
4143
logging_steps=1,
4244
report_to="trackio",
43-
project="trackio-transformers-demo",
45+
project=f"trackio-transformers-demo-{suffix}",
4446
push_to_hub=bool(hub_model_id),
4547
hub_model_id=hub_model_id,
4648
),

trackio/assets/badge.png

1.85 MB
Loading

0 commit comments

Comments
 (0)