SLM / README.md
rekhi's picture
Update README.md
b9ca884 verified
|
Raw History Blame Contribute Delete
921 Bytes
metadata
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

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()