-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcallback.py
46 lines (42 loc) · 1.65 KB
/
callback.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class CallbackArguments:
"""
Arguments pertaining to which model/config/tokenizer we are going to fine-tune from.
"""
# HuggingFace Hub
callback_save_to_hub: bool = field(
default=False,
metadata={"help": "Whether or not to save the model to the HuggingFace Hub in the ModelSaveCallback."},
)
callback_hub_model_name: Optional[str] = field(
default=None,
metadata={"help": "The name of the model on the HuggingFace Hub. If None, it will be the same as output_dir."},
)
callback_hub_organization: Optional[str] = field(
default=None,
metadata={"help": "The name of the organization on the HuggingFace Hub."},
)
callback_hub_private: bool = field(
default=False,
metadata={"help": "Whether or not the model is private on the HuggingFace Hub."},
)
callback_hub_exist_ok: bool = field(
default=False,
metadata={"help": "Whether or not to overwrite the model on the HuggingFace Hub."},
)
callback_hub_replace_model_card: bool = field(
default=False,
metadata={"help": "Whether or not to replace the model card on the HuggingFace Hub."},
)
callback_hub_train_datasets: Optional[list[str]] = field(
default=None,
metadata={"help": "The name of the datasets used to train the model on the HuggingFace Hub."},
)
callback_hub_run_as_future: bool = field(
default=False,
metadata={"help": "Whether or not to run the upload to the HuggingFace Hub as a future."},
)
def __post_init__(self):
pass