Run this model with HF Jobs

Run Asbyx/MNLP_M3_quantized_model_QAT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/Asbyx/MNLP_M3_quantized_model_QAT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/Asbyx/MNLP_M3_quantized_model_QAT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/Asbyx/MNLP_M3_quantized_model_QAT. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/Asbyx/MNLP_M3_quantized_model_QAT. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Asbyx's picture
Upload folder using huggingface_hub
d2a3eed verified
Raw History Blame Contribute Delete
955 Bytes
# Custom loading function for quantized model
import torch
from transformers import AutoModelForCausalLM, AutoConfig
def load_quantized_model(model_name_or_path, device="auto"):
"""
Load quantized model with proper handling of int8 parameters
"""
print("Loading quantized model...")
# Load with no gradients
with torch.no_grad():
model = AutoModelForCausalLM.from_pretrained(
model_name_or_path,
torch_dtype=torch.float32, # This will be mixed automatically
device_map=device,
trust_remote_code=True,
low_cpu_mem_usage=True
)
# Ensure int8 parameters don't require gradients
for name, param in model.named_parameters():
if param.dtype == torch.int8:
param.requires_grad = False
print("Model loaded successfully!")
return model
# Usage:
# model = load_quantized_model("your-username/your-model-name")