Skip to main content

Uploading Spaces

To upload spaces, you will need to create an account at CSGHub. Spaces are Git-based repositories, which give you versioning, branches, discoverability and sharing features. You can upload anything you want to the space repository.

We support two ways to upload files currently: using Git or web interface.

Upload Files to a Repository Using Git

  1. First clone the repository to your local machine. Copy the file to the corresponding repository.

  2. Assuming that your files are located in the /work/my_model_dir local directory, you can upload the local files to the platform with the following command:

    cd space123
    cp -rf /work/my_space_dir/* .
    git add .
    git commit -m "commit message"
    git push

[Note]

Files with the following suffixes are automatically uploaded with git-lfs:
.7z,.arrow,.bin,.bz2,.ckpt,.ftz,.gz,.h5,.joblib,.lz4,.mlmodel,.model,.msgpack,.npy,.npz,.onnx,.ot,.parquet,.pb,.pickle,.pkl,.pt,.pth,.rar,.safetensors,.tar,.tflite,.tgz,.wasm,.xz,.zip,.zst,.tfevents,.pcm,.sam,.raw,.aac,.flac,.mp3,.ogg,.wav,.bmp,.gif,.png,.tiff,.jpg,.jpeg,.webp

If there are other types of large files, run the following command to make them upload as lfs:

git lfs track <your_file_name>

Upload Files to a Repository Using Web Interface

To add files to your repository with the web interface, start by selecting the Files tab, and then clicking Add file. You will be given the option to create a new file or upload a file. Add new file

Creating a New File

Click Create new file, add the contents and click Create File to save your file. Add new create

Uploading a File

Click Upload file, you can choose a local file to upload.

Add new upload

查看应用空间的历史记录

每次进行add-commit-push循环时,应用空间都会跟踪您对文件所做的每项更改。您可以浏览应用空间文件和提交,并查看每次提交引入的差异(也称为diff)。要查看历史记录,您可以点击“提交历史”。 提交历史

也可以单击单个提交来查看该提交引入了哪些更改: 引入更改

Viewing the Space History

Each time you perform the add-commit-push, the space tracks every change you make to the files. You can browse the model files and commits, and view the differences (also known as diff) introduced by each commit. To view the history, click on "commit history." Commit History

You can also click on an individual commit to see what changes were introduced in that specific commit: Introduced Changes