MCPcopy Index your code
hub / github.com/YesianRohn/TextSSR / parse_cfgs

Function parse_cfgs

train_vae.py:39–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37torch.cuda.empty_cache()
38
39def parse_cfgs():
40 parser = argparse.ArgumentParser(description="Simple example of a training script.")
41 parser.add_argument('--config', type=str)
42 args = parser.parse_args()
43 cfgs = Config.fromfile(args.config)
44
45 env_local_rank = int(os.environ.get("LOCAL_RANK", -1))
46 if env_local_rank != -1 and env_local_rank != cfgs.local_rank:
47 cfgs.local_rank = env_local_rank
48
49 # default to using the same revision for the non-ema model if not specified
50 if cfgs.non_ema_revision is None:
51 cfgs.non_ema_revision = cfgs.revision
52
53 return cfgs
54
55
56def get_full_repo_name(model_id: str, organization: Optional[str] = None, token: Optional[str] = None):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected