{summary}
{audience/issues closed}
import torch_xla.core.xla_model as xm | |
import torch_xla.core.xla_env_vars as xenv | |
import os | |
def main(args=None): | |
print("I did something!") | |
if os.getenv(xenv.HOST_WORLD_SIZE, None) and xm.xrt_world_size() > 1: | |
xm.rendezvous("checking_out") | |
if __name__ == "__main__": |
#!/usr/bin/env python | |
# Copyright 2021 The HuggingFace Team. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
# fastai integration of Accelerate | |
from accelerate import Accelerator | |
from fastai.callback.core import Callback, CancelBatchException, CancelStepException | |
from fastai.learner import Learner, Metric | |
from fastai.metrics import AccumMetric | |
from fastai.optimizer import Optimizer, _update | |
from fastai.distributed import DistributedDL | |
from fastai.torch_core import to_device |
# Import ghapi, install with pip install ghapi | |
from ghapi.all import GhApi | |
# Tags for Issue, in this case it was difficulty levels | |
beg, mod, adv, exp = "Beginner,Moderate,Advanced,Expert".split(',') | |
# Template for writing start of issue information | |
def base_issue_template(nb_name, nb_url): | |
s = f"Add docments to [{nb_name}]({nb_url})\n\n" | |
s += f"See the [style guide]({style_guide_url}) and [contribution guide]({contrib_guide_url})" |