Downloading Models
If you want to get and download the models on the OpenCSG Community, we currently support downloading models via Git, Web interface, Command line and SDK.
Downloading Models Using Git
- Downloading model repositories using HTTP:
git lfs install
git clone https://www.opencsg.com//models/demo/test_model_1.git
- Downloading model repositories using SSH:
git lfs install
git clone git@hub.opencsg.com:models_demo/test_model_1.git
You will need to add your SSH public key to your user settings to push changes or access private repositories.
Downloading Files Using Web Interface
Click the download button under the Files tab to download the file directly.
Downloading Files Using Command Line
Use command line tool csghub-cli
to download data easily, the installation method is as follows:
pip install csghub-sdk
Here is an example of how to download a model:
export CSG_TOKEN=your_access_token
# download model
csghub-cli download demo/test_model
Downloading Files Using SDK
CSGHub SDK Provide a Python Libaray,you can download files by code.
Here is an example of how to download a model:
from pycsghub.snapshot_download import snapshot_download
token = "your_access_token"
endpoint = "https://hub.opencsg.com"
repo_id = 'OpenCSG/csg-wukong-1B'
cache_dir = '/Users/hhwang/temp/'
result = snapshot_download(repo_id, cache_dir=cache_dir, endpoint=endpoint, token=token)