Instructions to use staccs/qwencoin with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use staccs/qwencoin with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("staccs/qwencoin", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download tools/fetch.py from staccs/qwencoin: direct link, hf CLI and curl.
- Browser
- Download file 1.57 kB
-
https://huggingface.co/staccs/qwencoin/resolve/main/tools/fetch.py
- Command line
-
hf download hf://staccs/qwencoin/tools/fetch.py
-
curl -L -o fetch.py https://huggingface.co/staccs/qwencoin/resolve/main/tools/fetch.py
1.57 kB
| """Download a model's files into a local folder (nothing leaves this folder). | |
| python tools/fetch.py Qwen/Qwen3.5-4B base/Qwen3.5-4B | |
| If a Hugging Face token is on this machine (the one tools/publish.py uses: HF_TOKEN, or | |
| ~/.hugginface.key / ~/.huggingface.key) the download is authenticated with it: higher rate | |
| limits, faster. The token goes to huggingface.co only and is never printed. Without one the | |
| download is anonymous, which is enough for these public models. | |
| """ | |
| import sys, time | |
| from pathlib import Path | |
| from huggingface_hub import snapshot_download | |
| sys.path.insert(0, str(Path(__file__).resolve().parent)) | |
| try: | |
| from publish import token | |
| tok = token() | |
| except Exception: # noqa: BLE001 (anonymous then) | |
| tok = None | |
| repo, dest = sys.argv[1], sys.argv[2] | |
| for attempt in range(1, 8): # a connection that drops is not the end of it: what has arrived is kept, the rest is asked for again | |
| try: | |
| p = snapshot_download(repo_id=repo, local_dir=dest, allow_patterns=["*.json", "*.jinja", "*.txt", "*.safetensors"], token=tok or None) | |
| break | |
| except Exception as e: # noqa: BLE001 | |
| name = type(e).__name__ | |
| if attempt == 7 or name in ("RepositoryNotFoundError", "GatedRepoError", "RevisionNotFoundError"): | |
| raise | |
| wait = min(15 * attempt, 60) | |
| print(f" the download was interrupted ({name}: {" ".join(str(e).split())[:120]}); again in {wait}s, what has arrived is kept", flush=True) | |
| time.sleep(wait) | |
| print("downloaded", repo, "->", p, "(authenticated)" if tok else "(anonymous)") | |