MCPcopy Create free account
hub / github.com/AlayaLab/Hive / run

Method run

models/flowsep/diffusers/commands/env.py:35–80  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 download_parser.set_defaults(func=info_command_factory)
34
35 def run(self):
36 hub_version = huggingface_hub.__version__
37
38 pt_version = "not installed"
39 pt_cuda_available = "NA"
40 if is_torch_available():
41 import torch
42
43 pt_version = torch.__version__
44 pt_cuda_available = torch.cuda.is_available()
45
46 transformers_version = "not installed"
47 if is_transformers_available():
48 import transformers
49
50 transformers_version = transformers.__version__
51
52 accelerate_version = "not installed"
53 if is_accelerate_available():
54 import accelerate
55
56 accelerate_version = accelerate.__version__
57
58 xformers_version = "not installed"
59 if is_xformers_available():
60 import xformers
61
62 xformers_version = xformers.__version__
63
64 info = {
65 "`diffusers` version": version,
66 "Platform": platform.platform(),
67 "Python version": platform.python_version(),
68 "PyTorch version (GPU?)": f"{pt_version} ({pt_cuda_available})",
69 "Huggingface_hub version": hub_version,
70 "Transformers version": transformers_version,
71 "Accelerate version": accelerate_version,
72 "xFormers version": xformers_version,
73 "Using GPU in script?": "<fill in>",
74 "Using distributed or parallel set-up in script?": "<fill in>",
75 }
76
77 print("\nCopy-and-paste the text below in your GitHub issue and FILL OUT the two last points.\n")
78 print(self.format_dict(info))
79
80 return info
81
82 @staticmethod
83 def format_dict(d):

Callers 2

mainFunction · 0.45
__call__Method · 0.45

Calls 6

format_dictMethod · 0.95
is_torch_availableFunction · 0.85
is_accelerate_availableFunction · 0.85
is_xformers_availableFunction · 0.85
printFunction · 0.85

Tested by

no test coverage detected