|
Download README.md from rekhi/SLM: direct link, hf CLI and curl.
- Browser
- Download file 921 Bytes
-
https://huggingface.co/rekhi/SLM/resolve/main/README.md
- Command line
-
hf download hf://rekhi/SLM/README.md
-
curl -L -o README.md https://huggingface.co/rekhi/SLM/resolve/main/README.md
921 Bytes
| license: mit | |
| from pathlib import Path | |
| from huggingface_hub import HfApi | |
| repo_id = "rekhi/SLM" | |
| readme = """--- | |
| library_name: pytorch | |
| license: mit | |
| tags: | |
| - pytorch | |
| - custom-model | |
| - slm | |
| pipeline_tag: text-generation | |
| --- | |
| # SLM | |
| Lightweight SLM weights (`slm_model.pt`). | |
| > Replace this section with: architecture, training data, intended use, and limitations. | |
| ## Usage | |
| ```python | |
| import torch | |
| from huggingface_hub import hf_hub_download | |
| # Download the file | |
| ckpt_path = hf_hub_download(repo_id="rekhi/SLM", filename="slm_model.pt") | |
| # 1) If this is a full torch model (saved with torch.save(model)): | |
| model = torch.load(ckpt_path, map_location="cpu") | |
| model.eval() | |
| # 2) If this is a state_dict (saved with torch.save(model.state_dict())): | |
| # Define your model class exactly as used in training, then: | |
| # model = MyModel(**config) | |
| # model.load_state_dict(torch.load(ckpt_path, map_location="cpu")) | |
| # model.eval() | |