Add examples telemetry (#17552)
* Add examples telemetry * Alternative approach * Add to all other examples * Add to templates as well * Put framework separately * Same for TensorFlow
This commit is contained in:
@@ -42,7 +42,7 @@ from transformers import (
|
||||
set_seed,
|
||||
)
|
||||
from transformers.trainer_utils import get_last_checkpoint
|
||||
from transformers.utils import check_min_version
|
||||
from transformers.utils import check_min_version, send_example_telemetry
|
||||
from transformers.utils.versions import require_version
|
||||
|
||||
|
||||
@@ -112,8 +112,6 @@ class DataTrainingArguments:
|
||||
)
|
||||
},
|
||||
)
|
||||
server_ip: Optional[str] = field(default=None, metadata={"help": "For distant debugging."})
|
||||
server_port: Optional[str] = field(default=None, metadata={"help": "For distant debugging."})
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -176,14 +174,9 @@ def main():
|
||||
parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments))
|
||||
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
|
||||
|
||||
# Setup distant debugging if needed
|
||||
if data_args.server_ip and data_args.server_port:
|
||||
# Distant debugging - see https://code.visualstudio.com/docs/python/debugging#_attach-to-a-local-script
|
||||
import ptvsd
|
||||
|
||||
print("Waiting for debugger attach")
|
||||
ptvsd.enable_attach(address=(data_args.server_ip, data_args.server_port), redirect_output=True)
|
||||
ptvsd.wait_for_attach()
|
||||
# Sending telemetry. Tracking the example usage helps us better allocate resources to maintain them. The
|
||||
# information sent is the one passed as arguments along with your Python/PyTorch versions.
|
||||
send_example_telemetry("run_xnli", model_args)
|
||||
|
||||
# Setup logging
|
||||
logging.basicConfig(
|
||||
|
||||
Reference in New Issue
Block a user