SYMBOL INDEX (69 symbols across 11 files) FILE: demo_llama.py class Llama (line 23) | class Llama: method __init__ (line 24) | def __init__(self, onnxdir='models', config: dict = {}): method _make_causal_mask (line 47) | def _make_causal_mask(self, method _expand_mask (line 73) | def _expand_mask(self, mask, dtype, tgt_len=None): method _prepare_decoder_attention_mask (line 93) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape, method convert_to_fp16 (line 118) | def convert_to_fp16(self, inputs): method decode (line 127) | def decode(self, token: np.array): method apply_warp (line 179) | def apply_warp(self, tensor: np.array): method sample (line 184) | def sample(self, prompt: str = 'bonjour'): function parse_args (line 237) | def parse_args(): function main (line 274) | def main(): FILE: demo_rwkv.py class RWKV_RNN (line 11) | class RWKV_RNN(): method __init__ (line 13) | def __init__(self, onnxdir: str, n_layer=24): method forward (line 20) | def forward(self, token, state): function parse_args (line 33) | def parse_args(): function main (line 43) | def main(): FILE: llama/decoder.py class Decoder (line 7) | class Decoder: method __init__ (line 9) | def __init__(self, pool: MemoryPoolSimple, onnxdir: str, nameformat: s... method decode (line 23) | def decode(self, _inputs: dict, idx: int): method embed (line 31) | def embed(self, input_ids: np.array): method norm_head (line 37) | def norm_head(self, hidden: np.array): FILE: llama/logits_process.py function warp_topk (line 5) | def warp_topk(tensor: np.array, topk: int, fill_value = -float("Inf")): function warp_temperature (line 22) | def warp_temperature(tensor: np.array, temperature: float): function sample_logits (line 33) | def sample_logits(probs, temperature=1.0, top_p=0.85): FILE: llama/memory_pool.py class OrtWrapper (line 11) | class OrtWrapper: method __init__ (line 12) | def __init__(self, onnxfile: str): method forward (line 21) | def forward(self, _inputs: dict): method __del__ (line 32) | def __del__(self): class MemoryPoolSimple (line 37) | class MemoryPoolSimple: method __init__ (line 38) | def __init__(self, maxGB): method submit (line 46) | def submit(self, key: str, onnx_filepath: str): method used (line 56) | def used(self): method check (line 75) | def check(self): method fetch (line 87) | def fetch(self, key: str): FILE: llama/tokenizer.py class Tokenizer (line 11) | class Tokenizer: method __init__ (line 13) | def __init__(self, model_path: str): method encode (line 29) | def encode(self, s: str, bos: bool, eos: bool) -> List[int]: method decode (line 38) | def decode(self, t: List[int]) -> str: FILE: llama/utils.py function singleton (line 4) | def singleton(cls): function npsoftmax (line 18) | def npsoftmax(x, axis): function npmultinominal2D (line 23) | def npmultinominal2D(x): FILE: tools/convert-fp32-to-fp16.py function main (line 11) | def main(_input: str, output: str): function parse_args (line 32) | def parse_args(): FILE: tools/convert-to-tvm.py function convert (line 9) | def convert(filepath: str, outdir: str): function parse_args (line 31) | def parse_args(): FILE: tools/export-onnx.py class Predictor (line 22) | class Predictor(): method __init__ (line 23) | def __init__(self, outdir): method predict (line 29) | def predict( FILE: tools/onnx_RWKV_in_150_lines.py function onnx_fp32_to_fp16 (line 34) | def onnx_fp32_to_fp16(onnxfile: str): class Encoder (line 44) | class Encoder(torch.nn.Module): method __init__ (line 45) | def __init__(self, emb, ln_weight, ln_bias): method forward (line 51) | def forward(self, token): class Decoder (line 58) | class Decoder(torch.nn.Module): method __init__ (line 59) | def __init__(self, head, ln_weight, ln_bias): method forward (line 65) | def forward(self, x): class Mixer (line 71) | class Mixer(torch.nn.Module): method __init__ (line 72) | def __init__(self): method set_ffn (line 75) | def set_ffn(self, time_mix_k, time_mix_r, kw, vw, rw, ln_weight, ln_bi... method forward_ffn (line 84) | def forward_ffn(self, x, state): method set_attn (line 93) | def set_attn(self, time_mix_k, time_mix_v, time_mix_r, time_first, tim... method forward_att (line 108) | def forward_att(self, x, state): method forward (line 147) | def forward(self, x, state): class RWKV_RNN (line 153) | class RWKV_RNN(torch.jit.ScriptModule): method __init__ (line 155) | def __init__(self, args): method layer_norm (line 188) | def layer_norm(self, x, w): method encode_export (line 231) | def encode_export(self, token, emb, ln_weight, ln_bias): method decode_export (line 238) | def decode_export(self, x, head, ln_weight, ln_bias): method forward (line 243) | def forward(self, tokenid, state): function sample_logits (line 301) | def sample_logits(out, temperature=1.0, top_p=0.8):