Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ASLP-lab/OSUM-Pangu
/ functions
Functions
1,198 in github.com/ASLP-lab/OSUM-Pangu
⨍
Functions
1,198
◇
Types & classes
199
↓ 55 callers
Function
to_numpy
(tensor)
wenet/bin/export_onnx_cpu.py:59
↓ 49 callers
Method
decode
Decode input speech Args: methods:(List[str]): list of decoding methods to use, which could could contain the fo
wenet/transformer/asr_model.py:310
↓ 42 callers
Function
make_pad_mask
Make mask tensor containing indices of padded part. See description of make_non_pad_mask. Args: lengths (torch.Tensor): Batch of len
wenet/utils/mask.py:201
↓ 40 callers
Function
get_feat_from_wav_path
...
common_utils/utils4infer.py:60
↓ 32 callers
Method
log_softmax
log_softmax of frame activations Args: Tensor hs_pad: 3d tensor (B, Tmax, eprojs) Returns: torch.Tensor: log
wenet/transformer/ctc.py:121
↓ 29 callers
Method
update
(self)
wenet/dataset/dataset.py:62
↓ 20 callers
Method
keys
(self)
tools/compute-cer.py:246
↓ 16 callers
Function
open_or_fd
fd = open_or_fd(file) Open file, gzipped file, pipe, or forward the file-descriptor. Eventually seeks in the 'file' argument contains ':offset'
wenet/dataset/kaldi_io.py:54
↓ 14 callers
Function
init_model
(configs, encoder)
wenet/ssl/init_model.py:12
↓ 13 callers
Method
argmax
argmax of frame activations Args: torch.Tensor hs_pad: 3d tensor (B, Tmax, eprojs) Returns: torch.Tensor: arg
wenet/transformer/ctc.py:131
↓ 12 callers
Method
__init__
(self, dataset: IterDataPipe, buffer_size: int = 500, key_f
wenet/dataset/datapipes.py:154
↓ 12 callers
Method
_add_bos_eos
(self, bos, eos, inputs_embeds, attention_mask, target=None)
wenet/llm_asr/llmasr_model_instruct_version.py:1633
↓ 12 callers
Function
tensor_to_scalar
(x)
wenet/utils/common.py:359
↓ 10 callers
Method
__init__
(self, module)
wenet/bin/export_onnx_bpu.py:520
↓ 10 callers
Method
_get_embedding_from_wav
return: wav_embedding: (b, l, v) wav_mask: (b, l), wav为有效值的位置为true
wenet/llm_asr/llmasr_model_instruct_version.py:1581
↓ 10 callers
Method
generate
Generates responses for given prompts using Gemma model.
wenet/LLM/causallm_model.py:84
↓ 10 callers
Function
read_key
[key] = read_key(fd) Read the utterance-key from the opened ark/stream descriptor 'fd'.
wenet/dataset/kaldi_io.py:129
↓ 10 callers
Function
read_lists
(list_file)
wenet/utils/file_utils.py:18
↓ 9 callers
Function
Dataset
Construct dataset from arguments We have two shuffle stage in the Dataset. The first is global shuffle at shards tar/raw file level.
wenet/dataset/dataset.py:387
↓ 9 callers
Method
__init__
( self, optimizer: torch.optim.Optimizer, warmup_steps: Union[int, float, List[Union[i
wenet/utils/scheduler.py:43
↓ 9 callers
Method
__init__
( self, in_features: int, out_features: int, r: int = 0,
wenet/finetune/lora/layers.py:105
↓ 9 callers
Method
_sampler
Sample from logits. Args: logits: (1,1,vocab_size) temperatures: top_ps: top_ks:
wenet/llm_asr/llmasr_model_instruct_version.py:1747
↓ 9 callers
Function
init_tokenizer
(configs)
wenet/utils/init_tokenizer.py:26
↓ 9 callers
Function
s
(n)
tools/fst/ctc_token_fst_corrected.py:14
↓ 9 callers
Method
tokenize
(self, label: str)
wenet/cli/model.py:141
↓ 8 callers
Method
_build_tiktoken
(self)
wenet/text/whisper_tokenizer.py:46
↓ 8 callers
Function
add_sos_eos
Add <sos> and <eos> labels. Args: ys_pad (torch.Tensor): batch of padded target sequences (B, Lmax) sos (int): index of <sos>
wenet/utils/common.py:113
↓ 8 callers
Method
generate4chat
( self, wavs, wavs_len, prompt=" ", do_sample=True
wenet/llm_asr/llmasr_model_instruct_version.py:893
↓ 8 callers
Method
generate4chat_think
( self, wavs, wavs_len, do_sample=True, top_k=2,
wenet/llm_asr/llmasr_model_instruct_version.py:983
↓ 8 callers
Method
generate_text2text
( self, device, text, )
wenet/llm_asr/llmasr_model_instruct_version.py:1494
↓ 8 callers
Method
generate_tts
( self, device, prompt, text, )
wenet/llm_asr/llmasr_model_instruct_version.py:1245
↓ 8 callers
Function
get_answer_prompt_by_task
(task_tag, answer_tag, asr_txt=None)
wenet/llm_asr/wav_instrcut_tools.py:108
↓ 8 callers
Function
load_model_and_tokenizer
封装了加载模型和分词器的逻辑 Args: checkpoint_path (str): 模型权重文件路径 config_path (str): 模型配置文件路径 device (torch.device): 加载模型的设备 R
common_utils/utils4infer.py:19
↓ 8 callers
Method
position_encoding
(self, offset: Union[int, torch.Tensor], size: int)
wenet/transformer/subsampling.py:32
↓ 8 callers
Method
start
(self)
wenet/utils/common.py:347
↓ 8 callers
Function
to_numpy
(tensors)
wenet/bin/export_onnx_gpu.py:722
↓ 7 callers
Method
__init__
(self)
wenet/transformer/subsampling.py:27
↓ 7 callers
Method
_forward_linearx
(self, name: str, x: torch.Tensor,
wenet/transformer/attention.py:83
↓ 7 callers
Function
mask_to_bias
(mask: torch.Tensor, dtype: torch.dtype)
wenet/utils/common.py:316
↓ 7 callers
Method
output_size
(self)
wenet/transformer/encoder.py:121
↓ 6 callers
Method
__init__
Actually, this implements stacking frames and skipping frames. if m = 1 and n = 1, just return the origin features. if m = 1
wenet/paraformer/layers.py:25
↓ 6 callers
Method
_build_hugging_face
(self)
wenet/text/hugging_face_tokenizer.py:26
↓ 6 callers
Function
distort
Distort a waveform in sample point level Args: x: the origin wavefrom func: the distort function rate: sample point-level
wenet/dataset/wav_distortion.py:262
↓ 6 callers
Method
forward_attention
Compute attention context vector. Args: value (torch.Tensor): Transformed value, size (#batch, ..., n_head, time2
wenet/transformer/attention.py:133
↓ 6 callers
Function
load_checkpoint
(model: torch.nn.Module, path: str)
wenet/utils/checkpoint.py:37
↓ 6 callers
Function
log_add
Stable log add
wenet/utils/common.py:305
↓ 6 callers
Function
make_non_pad_mask
Make mask tensor containing indices of non-padded part. The sequences in a batch may have different lengths. To enable batch computing, paddi
wenet/utils/mask.py:230
↓ 6 callers
Function
override_config
(configs, override_list)
wenet/utils/config.py:18
↓ 6 callers
Function
pad_list
Perform padding for the list of tensors. Args: xs (List): List of Tensors [(T_1, `*`), (T_2, `*`), ..., (T_B, `*`)]. pad_value (f
wenet/utils/common.py:30
↓ 6 callers
Method
set_epoch
(self, epoch)
wenet/dataset/dataset.py:168
↓ 5 callers
Method
__init__
Construct an PositionalEncoding object.
wenet/transformer/embedding.py:38
↓ 5 callers
Function
db2amp
(db)
wenet/dataset/wav_distortion.py:23
↓ 5 callers
Function
do_s2t_speech_understanding
(model, input_wav_path, input_prompt)
infer_code/infer_ASR.py:38
↓ 5 callers
Function
do_s2t_speech_understanding
(model, input_wav_path, input_prompt)
infer_code/infer_VED.py:38
↓ 5 callers
Function
do_s2t_speech_understanding
(model, input_wav_path, input_prompt)
infer_code/infer_SRWT.py:38
↓ 5 callers
Function
do_s2t_speech_understanding
(model, input_wav_path, input_prompt)
infer_code/infer_STTC.py:38
↓ 5 callers
Function
do_s2t_speech_understanding
(model, input_wav_path, input_prompt)
infer_code/infer_SAP.py:38
↓ 5 callers
Function
do_s2t_speech_understanding
(model, input_wav_path, input_prompt)
infer_code/infer_SSR.py:38
↓ 5 callers
Function
do_s2t_speech_understanding
(model, input_wav_path, input_prompt)
infer_code/infer_SGC.py:38
↓ 5 callers
Function
do_s2t_speech_understanding
(model, input_wav_path, input_prompt)
infer_code/infer_SER.py:38
↓ 5 callers
Method
forward_qkv
Transform query, key and value. Args: query (torch.Tensor): Query tensor (#batch, ..., time1, size). key (torch.Tenso
wenet/transformer/attention.py:109
↓ 5 callers
Function
get_dataset
(data_type, data_list_file, tokenizer: BaseTokenizer, conf,
wenet/dataset/dataset.py:230
↓ 5 callers
Function
il
(n)
tools/fst/ctc_token_fst_corrected.py:6
↓ 5 callers
Method
init_state
( self, batch_size: int, device: torch.device, method: str = "zero", )
wenet/transducer/predictor.py:165
↓ 5 callers
Method
output_size
(self)
wenet/squeezeformer/encoder.py:184
↓ 5 callers
Function
print_input_output_info
(onnx_model, name, prefix="\t\t")
wenet/bin/export_onnx_cpu.py:66
↓ 5 callers
Function
save_data
(tensor, dirs, prefix)
tools/onnx2horizonbin.py:69
↓ 5 callers
Function
th_accuracy
Calculate accuracy. Args: pad_outputs (Tensor): Prediction tensors (B * Lmax, D). pad_targets (LongTensor): Target label tensors
wenet/utils/common.py:272
↓ 4 callers
Method
T
(self, w)
wenet/finetune/lora/layers.py:144
↓ 4 callers
Method
T
(self, w)
wenet/finetune/lora/layers.py:230
↓ 4 callers
Method
__init__
Construct an MultiHeadedAttention object.
wenet/transformer/attention.py:47
↓ 4 callers
Method
__init__
(self, encoder: BaseEncoder, ctc: CTC, beam_size: int = 10)
wenet/bin/export_onnx_gpu.py:44
↓ 4 callers
Method
__init__
Construct an Conv1dSubsampling object.
wenet/llm_asr/downsampler.py:15
↓ 4 callers
Function
_download_fn
(output_dir, name, renmae: Optional[str] = None, version: s
wenet/paraformer/convert_paraformer_to_wenet_config_and_ckpt.py:220
↓ 4 callers
Method
_forward_encoder
( self, speech: torch.Tensor, speech_lengths: torch.Tensor, decoding_chunk_siz
wenet/transformer/asr_model.py:271
↓ 4 callers
Method
_update_kv_and_cache
( self, k: torch.Tensor, v: torch.Tensor, cache: T_CACHE,
wenet/transformer/attention.py:180
↓ 4 callers
Function
add_optional_chunk_mask
Apply optional mask for encoder. Args: xs (torch.Tensor): padded input, (B, L, D), L for max length mask (torch.Tensor): mask fo
wenet/utils/mask.py:126
↓ 4 callers
Function
add_whisper_tokens
Add whisper-style tokens. ([PREV] -> [previous text tokens or hotwords]).optional -- ┌-----------------------------------------------------
wenet/utils/common.py:159
↓ 4 callers
Function
ctc_prefix_beam_search
Returns: List[List[List[int]]]: nbest result for each utterance
wenet/transformer/search.py:125
↓ 4 callers
Method
forward_chunk
Forward just one chunk Args: xs (torch.Tensor): chunk input, with shape (b=1, time, mel-dim), where `time == (ch
wenet/transformer/encoder.py:208
↓ 4 callers
Method
forward_step
Args: input (torch.Tensor): [batch_size, time_step=1] padding (torch.Tensor): [batch_size,1], 1 is padding value
wenet/transducer/predictor.py:185
↓ 4 callers
Method
generate
( self, wavs, wavs_len, prompt, **kwargs )
wenet/llm_asr/llmasr_model_instruct_version.py:828
↓ 4 callers
Function
generate_amp_mask
Generate amplitude domain mask randomly in [-100db, 0db] Args: mask_num: the slot number of the mask Returns: A list of tupl
wenet/dataset/wav_distortion.py:123
↓ 4 callers
Function
get_question_prompt_by_task
(task_tag)
wenet/llm_asr/wav_instrcut_tools.py:86
↓ 4 callers
Function
get_question_wav_path_by_task
(task_tag)
wenet/llm_asr/wav_instrcut_tools.py:97
↓ 4 callers
Function
lrs_to_str
(lrs: List)
wenet/utils/common.py:336
↓ 4 callers
Function
make_amp_mask
Get a amplitude domain mask from db domain mask Args: db_mask: Optional. A list of tuple. if None, using default value. Returns:
wenet/dataset/wav_distortion.py:105
↓ 4 callers
Method
reset_parameters
(self)
wenet/finetune/lora/layers.py:137
↓ 4 callers
Function
test
(xlist, blist, rtol=1e-3, atol=1e-5, tolerate_small_mismatch=True)
wenet/bin/export_onnx_gpu.py:735
↓ 4 callers
Method
train
(self, mode: bool = True)
wenet/finetune/lora/layers.py:147
↓ 3 callers
Method
__init__
(self, voca_size: int, embed_size: int, output_size: int,
wenet/transducer/predictor.py:62
↓ 3 callers
Method
__init__
(self, channel: int, out_dim: int, kernel_size: int = 5,
wenet/squeezeformer/subsampling.py:109
↓ 3 callers
Method
__init__
Args: input_size (int): input dim output_size (int): dimension of attention attention_heads (int): the nu
wenet/transformer/encoder.py:40
↓ 3 callers
Method
_forward_encoder
( self, speech: torch.Tensor, speech_lengths: torch.Tensor, decoding_chunk_siz
wenet/paraformer/paraformer.py:276
↓ 3 callers
Method
_get_linear_warmup_with_cosine_annealing_lr
(self, step)
wenet/utils/scheduler.py:548
↓ 3 callers
Method
_get_warmup_lr
(self, step)
wenet/utils/scheduler.py:133
↓ 3 callers
Method
calculate_downsampling_factor
(self, i: int)
wenet/efficient_conformer/encoder.py:237
↓ 3 callers
Method
calculate_downsampling_factor
(self, i: int)
wenet/bin/export_onnx_gpu.py:450
↓ 3 callers
Function
compute_mask_indices_v2
( shape, padding_mask, mask_prob: float, mask_length: int, mask_type:
wenet/ssl/bestrq/mask.py:58
↓ 3 callers
Method
copy_context
(self, prefix_score)
wenet/transformer/search.py:95
next →
1–100 of 1,198, ranked by callers