Download fairseq/model_parallel/models/__init__.py from charlesnovak/EnzyGen: direct link, hf CLI and curl.
- Browser
- Download file 701 Bytes
-
https://huggingface.co/charlesnovak/EnzyGen/resolve/main/fairseq/model_parallel/models/__init__.py
- Command line
-
hf download hf://charlesnovak/EnzyGen/fairseq/model_parallel/models/__init__.py
-
curl -L -o __init__.py https://huggingface.co/charlesnovak/EnzyGen/resolve/main/fairseq/model_parallel/models/__init__.py
701 Bytes
| # Copyright (c) Facebook, Inc. and its affiliates. | |
| # | |
| # This source code is licensed under the MIT license found in the | |
| # LICENSE file in the root directory of this source tree. | |
| import importlib | |
| import os | |
| # automatically import any Python files in the models/ directory | |
| models_dir = os.path.dirname(__file__) | |
| for file in os.listdir(models_dir): | |
| path = os.path.join(models_dir, file) | |
| if ( | |
| not file.startswith("_") | |
| and not file.startswith(".") | |
| and (file.endswith(".py") or os.path.isdir(path)) | |
| ): | |
| model_name = file[: file.find(".py")] if file.endswith(".py") else file | |
| module = importlib.import_module("fairseq.model_parallel.models." + model_name) | |