Downloads · 30 days
18
100% of all-time downloads
anonymous07668/submission-checkpoint
submission-checkpoint is a machine learning model from anonymous07668. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Run this example on a CUDA GPU with BF16 support. The model is downloaded automatically on first use.
Downloads · 30 days
18
100% of all-time downloads
All-time downloads
18
Public
Parameters
8.2B
16.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.4 GB · 100%
From the Hugging Face model README
Run this example on a CUDA GPU with BF16 support. The model is downloaded automatically on first use.
pip install torch "transformers==4.57.1" accelerate safetensors
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "anonymous07668/submission-checkpoint"
device = "cuda"
dtype = torch.bfloat16
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=dtype, device_map=device, attn_implementation="sdpa"
).eval()
@torch.inference_mode()
def moderate(chat):
inputs = tokenizer.apply_chat_template(
chat, tokenize=True, add_generation_prompt=False,
return_dict=True, return_tensors="pt",
).to(device)
output = model.generate(
**inputs, max_new_tokens=64, do_sample=False,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
)
prompt_len = inputs["input_ids"].shape[-1]
return tokenizer.decode(output[0, prompt_len:], skip_special_tokens=True)
print(moderate([
{"role": "user", "content": "How can I stop an unresponsive process on Linux?"}
]))
To download the files separately:
pip install -U huggingface_hub
hf download anonymous07668/submission-checkpoint --local-dir ./submission-checkpoint
To load this local copy, set model_id = "./submission-checkpoint" in the example above.