Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LaurentMazare/mamba.rs
/ functions
Functions
60 in github.com/LaurentMazare/mamba.rs
⨍
Functions
60
◇
Types & classes
16
↓ 16 callers
Function
write_buffer
(w: torch.Tensor, cast_to_float: bool = True)
get_weights.py:54
↓ 13 callers
Function
get_tensor
(name: str, exp_shape)
get_weights.py:24
↓ 10 callers
Method
forward
https://github.com/srush/llama2.rs/blob/2ca8f3dc0d4aa945a29700271883af72d9043ef1/src/model.rs#L22
src/model.rs:13
↓ 3 callers
Method
encode
The main tokenization entry point, takes as input a string and returns the list of tokens.
src/tokenizer.rs:310
↓ 2 callers
Function
add_in_place
(a: &mut [f32], b: &[f32])
src/model.rs:56
↓ 2 callers
Method
decode_token_id
This should be memoized if it starts to be on the critical path.
src/tokenizer.rs:404
↓ 2 callers
Method
sample
(&mut self, logits: &[f32; constants::VOCAB_SIZE])
src/main.rs:149
↓ 2 callers
Function
silu_in_place
(s: &mut [f32])
src/model.rs:68
↓ 2 callers
Function
tokenize
(text, tokenizer, bos=True, eos=False)
jax/data.py:7
↓ 2 callers
Method
update
(&mut self, tokens: &[u32; B], w: &Weights)
src/model_inc.rs:71
↓ 2 callers
Method
update_state
(&self, state: &mut Self::State<B>, tokens: &[u32; B])
src/model_inc.rs:178
↓ 2 callers
Method
weights
(&self)
src/main.rs:35
↓ 1 callers
Function
bias_init_dt_proj
(d_inner)
jax/model.py:37
↓ 1 callers
Method
bpe
(&self, word: &str)
src/tokenizer.rs:334
↓ 1 callers
Method
decode
The inverse of the tokenization process, takes as input a list of tokens and returns a string that produces this tokenization.
src/tokenizer.rs:387
↓ 1 callers
Function
dot
(v1: &[f32; B], v2: &[f32; B])
src/model.rs:81
↓ 1 callers
Method
forward_one
(&self, o: &mut [f32; DIM], xo: &[f32; DIM], epsilon: f32)
src/model.rs:29
↓ 1 callers
Method
get_token
(&self, s: &str)
src/tokenizer.rs:399
↓ 1 callers
Function
kernel_init_dt_proj
(dt_rank)
jax/model.py:28
↓ 1 callers
Function
kernel_init_prenorm
(n_layer)
jax/model.py:18
↓ 1 callers
Function
load_data
(filename, tokenizer, bsz, csz)
jax/data.py:58
↓ 1 callers
Function
load_glob
(g, tokenizer, bsz, csz)
jax/data.py:75
↓ 1 callers
Method
logits
(&self)
src/model_inc.rs:165
↓ 1 callers
Function
mul_in_place
(a: &mut [f32], b: &[f32])
src/model.rs:62
↓ 1 callers
Function
prod
(vs)
jax/train.py:40
↓ 1 callers
Method
sample_argmax
(&mut self, logits: &[f32])
src/main.rs:133
↓ 1 callers
Method
sample_multinomial
(&mut self, prs: &[f32])
src/main.rs:143
↓ 1 callers
Function
selective_scan_p
(u, delta, a, b, c, d)
jax/model.py:106
↓ 1 callers
Function
selective_scan_py
(u, delta, a, b, c, d)
jax/model.py:136
↓ 1 callers
Function
selective_scan_s
(u, delta, a, b, c, d)
jax/model.py:155
↓ 1 callers
Function
softplus_in_place
(s: &mut [f32])
src/model.rs:74
↓ 1 callers
Function
step
(params, opt_state, x, y)
jax/train.py:111
Method
__call__
(self, xs)
jax/model.py:66
Method
__call__
(self, xs)
jax/model.py:182
Method
__call__
(self, xs)
jax/model.py:243
Method
__call__
(self, xs)
jax/model.py:254
Function
a_log_init
(rng, shape)
jax/model.py:55
Function
batch_iterator
(iterator, bsz, csz)
jax/data.py:45
Method
d_inner
(self)
jax/model.py:98
Method
default
()
src/model_inc.rs:188
Function
detokenize
(tokens, tokenizer)
jax/data.py:21
Method
dt_rank
(self)
jax/model.py:94
Function
embedding_init
(key, shape, dtype)
jax/model.py:13
Function
f
(rhs, lhs)
jax/model.py:122
Method
from_file
This function is unsafe as it uses mmap and doesn't check the file size.
src/main.rs:20
Method
get_pairs
(word: &[Vec<u8>])
src/tokenizer.rs:324
Function
init
()
jax/train.py:89
Function
init
(key, shape, dtype)
jax/model.py:31
Function
jsonl_iterator
(filename, remove_example=lambda x: False)
jax/data.py:26
Function
loss
(params, x, y)
jax/train.py:105
Function
main
()
src/main.rs:68
Method
new
(seed: u64, temperature: f64)
src/main.rs:128
Method
new
()
src/model_inc.rs:53
Method
new
Creates a new tokenizer, this takes as input the path for the bpe rank file.
src/tokenizer.rs:277
Method
new_state
()
src/model_inc.rs:174
Function
run
(prompt: String, temperature: f64)
src/main.rs:79
Method
state_logits
(state: &Self::State<B>)
src/model_inc.rs:182
Function
token_iterator
(iterator, tokenizer, field="text")
jax/data.py:35
Method
vocab_size
(self)
jax/model.py:89
Function
wd_mask
(params)
jax/train.py:57