CSGHub icon indicating copy to clipboard operation
CSGHub copied to clipboard

set CSG_TOKEN after . Upload model error in Windows PowerShell

Open goodtab opened this issue 3 months ago • 12 comments

set CSG_TOKEN=********** use : csghub-cli upload-large-folder goodtab/Kronos-base E:/BaiduNetdiskDownload/SD/Ai/Ai/Kronos-base error report :2025-10-01 19:36:09 - ERROR - create new model goodtab/Kronos-base on https://hub.opencsg.com response: {"code":"AUTH-ERR-1","msg":"AUTH-ERR-1: User not found, please login first"}`

goodtab avatar Oct 01 '25 11:10 goodtab

@goodtab Please use following env and use latest sdk version.

export CSGHUB_TOKEN=your_access_token

https://github.com/OpenCSGs/csghub-sdk/blob/main/doc/cli.md

HaiHui886 avatar Oct 01 '25 11:10 HaiHui886

use export The command execution will report an error, so I used the set command export: The term 'export' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Run the following command: csghub-cli upload-large-folder goodtab/Kronos-base E:/BaiduNetdiskDownload/SD/Ai/Ai/Kronos-base It will report an error: `2025-10-01 19:36:09 - ERROR - create new model goodtab/Kronos-base on https://hub.opencsg.com/ response: {"code":"AUTH-ERR-1","msg":"AUTH-ERR-1: User not found, please login first"}``

goodtab avatar Oct 02 '25 01:10 goodtab

Please append following info:

  1. csghub sdk version?
  2. os version?
  3. python version?
  4. Replace your_access_token with your own key get from https://opencsg.com

HaiHui886 avatar Oct 02 '25 02:10 HaiHui886

Please reference if you run sdk on windows:

(hubsdk) C:\Users\wangh>set CSGHUB_TOKEN=3028xxxxxxxxxxxxxxxxxxxx414eb33d1

(hubsdk) C:\Users\wangh>csghub-cli upload-large-folder wanghh2000/mod03 D:/tmp/json
2025-10-02 10:40:52 - INFO - repo model wanghh2000/mod03 created
recovering from cache metadata from D:\tmp\json/f.cache: 100%|█████████████████████████████████████| 2/2 [00:00<00:00, 285.58it/s]
2025-10-02 10:40:52 - INFO - starting 10 worker threads for upload tasks
2025-10-02 10:40:52 - INFO - init upload status, found 2 files, queue(sha): 2, queue(mode): 0, queue(preupload): 0, queue(commit): 0
computing sha256 for D:\tmp\json\2.json: 100%|█████████████████████████████████████████████████| 31.0/31.0 [00:00<00:00, 15.0kB/s]
computing sha256 for D:\tmp\json\1.txt: 100%|██████████████████████████████████████████████████| 19.0/19.0 [00:00<00:00, 3.65kB/s]
converting D:\tmp\json\2.json to base64: 100%|█████████████████████████████████████████████████| 31.0/31.0 [00:00<00:00, 23.2kB/s]
converting D:\tmp\json\1.txt to base64: 100%|██████████████████████████████████████████████████████████| 19.0/19.0 [00:00<?, ?B/s]
2025-10-02 10:40:53 - INFO - committed 2 items
2025-10-02 10:40:53 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:53 - INFO - all files are done and exiting main loop
2025-10-02 10:40:55 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:55 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:55 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:55 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:55 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:55 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:55 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:55 - INFO - all files have been processed! Exiting worker.
2025-10-02 10:40:56 - INFO - all files have been processed! Exiting worker.

---------- 2025-10-02 10:40:56 (0:00:03) ----------
Files:   hashed 2/2 (50.0/50.0) | pre-uploaded: 0/0 (0.0/50.0) | queued-slices: 0 | committed: 2/2 (50.0/50.0) | ignored: 0
Workers: hashing: 0 | get upload mode: 0 | pre-uploading: 0 | slices-uploading: 0 | committing: 0 | waiting: 0
---------------------------------------------------
2025-10-02 10:40:56 - INFO - large folder upload process is complete!
Image

HaiHui886 avatar Oct 02 '25 02:10 HaiHui886

goodtab

Please make sure you have already register user goodtab on opencsg.com. The error message means user name goodtab is invalid.

HaiHui886 avatar Oct 02 '25 02:10 HaiHui886

I have registered an account, goodtab. Here is my invitation registration link, and my Python version is Python 3.10. Is my Python version too low

Image Image

Is it because my model library is private that I cannot upload it

goodtab avatar Oct 03 '25 05:10 goodtab

I understand now, you need to use CMD to execute commands, PowerShell cannot execute csghub cli commands I also hope to support PowerShell 7.5 as soon as possible

goodtab avatar Oct 03 '25 05:10 goodtab

We encountered another problem, uploading the dataset but it was uploaded to the model. What is the situation?

Image

goodtab avatar Oct 03 '25 06:10 goodtab

Can you describe your steps? Or can you replicate?

samchen8008 avatar Oct 04 '25 07:10 samchen8008

@goodtab Please use -t dataset parameter in cmd.

Reference:

(sdk) wanghaihui:csghub-sdk hhwang$ csghub-cli upload-large-folder -h

 Usage: csghub-cli upload-large-folder [OPTIONS] REPO_ID LOCAL_PATH

 Upload large folder to OpenCSG Hub using multiple workers


╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    repo_id         TEXT  The ID of the repo. (e.g. `username/repo-name`). [default: None] [required]                                                                                                                                            │
│ *    local_path      TEXT  Local path to the folder to upload. [default: None] [required]                                                                                                                                                         │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --repo-type           -t      [model|dataset|space]  Specify the repository type. [default: model]                                                                                                                                                │
│ --revision            -r      TEXT                   An optional Git revision id which can be a branch name [default: main]                                                                                                                       │
│ --endpoint            -e      TEXT                   The address of the request to be sent. [default: https://hub.opencsg.com]                                                                                                                    │
│ --token               -k      TEXT                   A User Access Token generated from https://opencsg.com/settings/access-token [default: None]                                                                                                 │
│ --allow-patterns              TEXT                   Allow patterns for files to be downloaded. [default: None]                                                                                                                                   │
│ --ignore-patterns             TEXT                   Ignore patterns for files to be downloaded. [default: None]                                                                                                                                  │
│ --num-workers         -n      INTEGER                Number of concurrent upload workers. [default: None]                                                                                                                                         │
│ --print-report                                       Whether to print a report of the upload progress. Defaults to True.                                                                                                                          │
│ --print-report-every          INTEGER                Frequency at which the report is printed. Defaults to 60 seconds. [default: 60]                                                                                                              │
│ --help                -h                             Show this message and exit.                                                                                                                                                                  │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

HaiHui886 avatar Oct 09 '25 01:10 HaiHui886

I understand now, you need to use CMD to execute commands, PowerShell cannot execute csghub cli commands I also hope to support PowerShell 7.5 as soon as possible

Log an issue to trace https://github.com/OpenCSGs/csghub-sdk/issues/107

HaiHui886 avatar Oct 09 '25 01:10 HaiHui886

Please reference https://github.com/OpenCSGs/csghub-sdk/pull/108 for how use csghub sdk on window powershell.

HaiHui886 avatar Nov 19 '25 03:11 HaiHui886