MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / create_model

Function create_model

examples/xpu/benchmark_paged_memory.py:52–64  ·  view source on GitHub ↗

Create a LLaMA model from config (no download needed).

(args)

Source from the content-addressed store, hash-verified

50
51
52def create_model(args):
53 """Create a LLaMA model from config (no download needed)."""
54 config = LlamaConfig(
55 hidden_size=args.hidden_size,
56 intermediate_size=args.intermediate_size,
57 num_hidden_layers=args.num_layers,
58 num_attention_heads=args.num_heads,
59 vocab_size=args.vocab_size,
60 max_position_embeddings=args.seq_len * 2,
61 )
62 dtype = get_torch_dtype(args.dtype)
63 model = LlamaForCausalLM(config).to(dtype=dtype, device=args.device)
64 return model
65
66
67def make_batch(args):

Callers 2

measure_trainingFunction · 0.85
mainFunction · 0.85

Calls 2

get_torch_dtypeFunction · 0.70
toMethod · 0.45

Tested by

no test coverage detected