abideen / Bitnet-Llama-70M

huggingface.co
Total runs: 458
24-hour runs: 1
7-day runs: 76
30-day runs: 397
Model's Last Updated: April 04 2024
text-generation

Introduction of Bitnet-Llama-70M

Model Details of Bitnet-Llama-70M

Bitnet-LLama-70M

image/jpeg

Bitnet-LLama-70M is a 70M parameter model trained using the method described in The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits .

It was trained on the subset of the HuggingFaceTB/cosmopedia dataset. This is just a small experiment to try out BitNet. Bitnet-LLama-70M was trained for 2 epochs on 1xA100.

This model is just an experiment and you might not get good results while chatting with it due to smaller model size and less training.

Wandb training report is as follows:

image/png

Sample inference code

from transformers import AutoModelForCausalLM, AutoTokenizer

# Load a pretrained BitNet model
model = "abideen/Bitnet-Llama-70M"
tokenizer = AutoTokenizer.from_pretrained(model)
model = AutoModelForCausalLM.from_pretrained(model)

def convert_to_bitnet(model, copy_weights):
    for name, module in model.named_modules():
        # Replace linear layers with BitNet
        if isinstance(module, LlamaSdpaAttention) or isinstance(module, LlamaMLP):
            for child_name, child_module in module.named_children():
                if isinstance(child_module, nn.Linear):
                    bitlinear = BitLinear(child_module.in_features, child_module.out_features, child_module.bias is not None).to(device="cuda:0")
                    if copy_weights:
                        bitlinear.weight = child_module.weight
                        if child_module.bias is not None:
                            bitlinear.bias = child_module.bias
                    setattr(module, child_name, bitlinear)
        # Remove redundant input_layernorms
        elif isinstance(module, LlamaDecoderLayer):
            for child_name, child_module in module.named_children():
                if isinstance(child_module, LlamaRMSNorm) and child_name == "input_layernorm":
                    setattr(module, child_name, nn.Identity().to(device="cuda:0"))
              

convert_to_bitnet(model, copy_weights=True)
model.to(device="cuda:0")

prompt = "What is Machine Learning?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
generate_ids = model.generate(inputs.input_ids, max_length=100)
tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]

Runs of abideen Bitnet-Llama-70M on huggingface.co

458
Total runs
1
24-hour runs
54
3-day runs
76
7-day runs
397
30-day runs

More Information About Bitnet-Llama-70M huggingface.co Model

More Bitnet-Llama-70M license Visit here:

https://choosealicense.com/licenses/apache-2.0

Bitnet-Llama-70M huggingface.co

Bitnet-Llama-70M huggingface.co is an AI model on huggingface.co that provides Bitnet-Llama-70M's model effect (), which can be used instantly with this abideen Bitnet-Llama-70M model. huggingface.co supports a free trial of the Bitnet-Llama-70M model, and also provides paid use of the Bitnet-Llama-70M. Support call Bitnet-Llama-70M model through api, including Node.js, Python, http.

Bitnet-Llama-70M huggingface.co Url

https://huggingface.co/abideen/Bitnet-Llama-70M

abideen Bitnet-Llama-70M online free

Bitnet-Llama-70M huggingface.co is an online trial and call api platform, which integrates Bitnet-Llama-70M's modeling effects, including api services, and provides a free online trial of Bitnet-Llama-70M, you can try Bitnet-Llama-70M online for free by clicking the link below.

abideen Bitnet-Llama-70M online free url in huggingface.co:

https://huggingface.co/abideen/Bitnet-Llama-70M

Bitnet-Llama-70M install

Bitnet-Llama-70M is an open source model from GitHub that offers a free installation service, and any user can find Bitnet-Llama-70M on GitHub to install. At the same time, huggingface.co provides the effect of Bitnet-Llama-70M install, users can directly use Bitnet-Llama-70M installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Bitnet-Llama-70M install url in huggingface.co:

https://huggingface.co/abideen/Bitnet-Llama-70M

Url of Bitnet-Llama-70M

Bitnet-Llama-70M huggingface.co Url

Provider of Bitnet-Llama-70M huggingface.co

abideen
ORGANIZATIONS

Other API from abideen

huggingface.co

Total runs: 75
Run Growth: 2
Growth Rate: 2.67%
Updated:March 17 2024
huggingface.co

Total runs: 24
Run Growth: 17
Growth Rate: 70.83%
Updated:April 15 2024
huggingface.co

Total runs: 23
Run Growth: 5
Growth Rate: 21.74%
Updated:January 11 2024
huggingface.co

Total runs: 17
Run Growth: 11
Growth Rate: 64.71%
Updated:February 22 2024
huggingface.co

Total runs: 5
Run Growth: 0
Growth Rate: 0.00%
Updated:January 07 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 29 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:December 21 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 13 2025