yujiepan / meta-llama-3.1-tiny-random-hidden128

huggingface.co
Total runs: 707
24-hour runs: 0
7-day runs: 367
30-day runs: 568
Model's Last Updated: August 05 2024
text-generation

Introduction of meta-llama-3.1-tiny-random-hidden128

Model Details of meta-llama-3.1-tiny-random-hidden128

This model is for debugging. It is randomly initialized using the config from meta-llama/Meta-Llama-3.1-70B-Instruct but with smaller size.

Codes:

import os

import torch
import transformers
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, GenerationConfig, pipeline, set_seed

model_id = "meta-llama/Meta-Llama-3.1-70B-Instruct"
repo_id = "yujiepan/meta-llama-3.1-tiny-random-hidden128"
save_path = f"/tmp/{repo_id}"

config = AutoConfig.from_pretrained(model_id, trust_remote_code=True)
config._name_or_path = model_id
config.hidden_size = 128
config.intermediate_size = 256
config.num_attention_heads = 2
config.num_key_value_heads = 1
config.num_hidden_layers = 2
config.torch_dtype = "bfloat16"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
tokenizer.save_pretrained(save_path)

model = AutoModelForCausalLM.from_config(
    config, torch_dtype=torch.bfloat16, attn_implementation="sdpa", trust_remote_code=True
)
model.generation_config = GenerationConfig.from_pretrained(model_id, trust_remote_code=True)

set_seed(42)
with torch.no_grad():
    for _, p in sorted(model.named_parameters()):
        torch.nn.init.uniform_(p, -0.2, 0.2)

model.save_pretrained(save_path)

pipe = pipeline("text-generation", model=save_path, device="cuda", trust_remote_code=True, max_new_tokens=20)
print(pipe("Hello World!"))

Runs of yujiepan meta-llama-3.1-tiny-random-hidden128 on huggingface.co

707
Total runs
0
24-hour runs
196
3-day runs
367
7-day runs
568
30-day runs

More Information About meta-llama-3.1-tiny-random-hidden128 huggingface.co Model

meta-llama-3.1-tiny-random-hidden128 huggingface.co

meta-llama-3.1-tiny-random-hidden128 huggingface.co is an AI model on huggingface.co that provides meta-llama-3.1-tiny-random-hidden128's model effect (), which can be used instantly with this yujiepan meta-llama-3.1-tiny-random-hidden128 model. huggingface.co supports a free trial of the meta-llama-3.1-tiny-random-hidden128 model, and also provides paid use of the meta-llama-3.1-tiny-random-hidden128. Support call meta-llama-3.1-tiny-random-hidden128 model through api, including Node.js, Python, http.

meta-llama-3.1-tiny-random-hidden128 huggingface.co Url

https://huggingface.co/yujiepan/meta-llama-3.1-tiny-random-hidden128

yujiepan meta-llama-3.1-tiny-random-hidden128 online free

meta-llama-3.1-tiny-random-hidden128 huggingface.co is an online trial and call api platform, which integrates meta-llama-3.1-tiny-random-hidden128's modeling effects, including api services, and provides a free online trial of meta-llama-3.1-tiny-random-hidden128, you can try meta-llama-3.1-tiny-random-hidden128 online for free by clicking the link below.

yujiepan meta-llama-3.1-tiny-random-hidden128 online free url in huggingface.co:

https://huggingface.co/yujiepan/meta-llama-3.1-tiny-random-hidden128

meta-llama-3.1-tiny-random-hidden128 install

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

meta-llama-3.1-tiny-random-hidden128 install url in huggingface.co:

https://huggingface.co/yujiepan/meta-llama-3.1-tiny-random-hidden128

Url of meta-llama-3.1-tiny-random-hidden128

meta-llama-3.1-tiny-random-hidden128 huggingface.co Url

Provider of meta-llama-3.1-tiny-random-hidden128 huggingface.co

yujiepan
ORGANIZATIONS

Other API from yujiepan