Run this model with HF Jobs

Run HachiML/myBit-Llama2-jp-127M-4 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/HachiML/myBit-Llama2-jp-127M-4. 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/HachiML/myBit-Llama2-jp-127M-4 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/HachiML/myBit-Llama2-jp-127M-4. 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/HachiML/myBit-Llama2-jp-127M-4. 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.

myBit-Llama2-jp-127M-4

This model has 127M parameters.
The model is a pre-trained Bit-Llama2 of Parameters with only 1 epoch on a Japanese dataset. The dataset used is range3/wiki40b-ja.

  • Loss: 2.9790

Model description

Github๏ผšใ€€BitNet-b158
More information about this model can be found in the following pages:

How to use

  1. install the library
!pip install mybitnet==0.2.3
!pip install -U accelerate transformers==4.38.2
!pip install torch
  1. get model
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "HachiML/myBit-Llama2-jp-127M-4"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
print(model)
  1. inference
prompt = "ๆ˜”ใ€…ใ‚ใ‚‹ใจใ“ใ‚ใซใ€"
input_ids = tokenizer.encode(
    prompt,
    return_tensors="pt"
)
tokens = model.generate(
    input_ids.to(device=model.device),
    max_new_tokens=128,
)

out = tokenizer.decode(tokens[0], skip_special_tokens=True)
print(out)

Intended uses & limitations

More information needed

Training and evaluation data

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 0.0024
  • train_batch_size: 96
  • eval_batch_size: 96
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: polynomial
  • lr_scheduler_warmup_steps: 5000
  • num_epochs: 1

Training results

Training Loss Epoch Step Validation Loss
4.8696 0.05 2000 3.8588
3.7027 0.1 4000 3.6106
3.5648 0.15 6000 3.5014
3.448 0.2 8000 3.4153
3.3884 0.25 10000 3.3650
3.3462 0.29 12000 3.3280
3.3155 0.34 14000 3.3053
3.2932 0.39 16000 3.2891
3.2762 0.44 18000 3.2673
3.2594 0.49 20000 3.2533
3.2432 0.54 22000 3.2398
3.2286 0.59 24000 3.2186
3.2083 0.64 26000 3.1957
3.1867 0.69 28000 3.1769
3.1676 0.74 30000 3.1568
3.14 0.79 32000 3.1286
3.114 0.83 34000 3.1006
3.0848 0.88 36000 3.0696
3.0511 0.93 38000 3.0301
3.005 0.98 40000 2.9790

Framework versions

  • Transformers 4.38.2
  • Pytorch 2.2.1+cu121
  • Datasets 2.18.0
  • Tokenizers 0.15.2
Downloads last month
20
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support