Downloads · 30 days
22
17% of all-time downloads
canbingol/exp2_sdpa_1epoch_lr1e4_500k_vngr_corpus
exp2_sdpa_1epoch_lr1e4_500k_vngr_corpus is a text generation model from canbingol. Use it when you need the model to write or continue text.
This repository contains a causal language model trained using the lm-pretrain framework. Source code: https://github.com/canbingol/lm-pretrain
Downloads · 30 days
22
17% of all-time downloads
All-time downloads
126
Public
Parameters
56.9M
228 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors228 MB · 98%
From the Hugging Face model README
This repository contains a causal language model trained using the lm-pretrain framework.
Source code: https://github.com/canbingol/lm-pretrain
from huggingface_hub import hf_hub_download
hf_hub_download(
repo_id="canbingol/exp2_sdpa_1epoch_lr1e4_500k_vngr_corpus",
filename="model.py",
repo_type="model",
local_dir="./"
)
import torch
from transformers import AutoTokenizer
from model import DecoderCausalLM
model_path = "canbingol/exp2_sdpa_1epoch_lr1e4_500k_vngr_corpus"
device = "cuda" if torch.cuda.is_available() else "cpu"
model = DecoderCausalLM.from_pretrained(model_path).to(device=device, dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained(model_path)
input_ids = tokenizer.encode("selam ben", return_tensors="pt").to(device)
out_tokens = model.generate(input_ids)
generated_text = tokenizer.decode(out_tokens.flatten())
print(generated_text)
DecoderCausalLM implementation is included in the model files (model.py).