Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Ljyustc/SocraticLM
/ functions
Functions
47 in github.com/Ljyustc/SocraticLM
⨍
Functions
47
◇
Types & classes
7
↓ 14 callers
Method
get_command
(self, token)
codes/tokenization_chatglm.py:124
↓ 6 callers
Method
build_single_message
(self, role, metadata, message)
codes/tokenization_chatglm.py:231
↓ 5 callers
Method
encode
(self, s: str, bos: bool = False, eos: bool = False)
codes/tokenization_chatglm.py:52
↓ 4 callers
Method
_pad_tensors_to_max_len
(self, tensor, max_length)
codes/trainer_seq2seq.py:231
↓ 4 callers
Function
print_dataset_example
(example)
codes/main.py:395
↓ 3 callers
Method
vocab_size
(self)
codes/tokenization_chatglm.py:167
↓ 2 callers
Method
build_prompt
(self, query, history=None)
codes/tokenization_chatglm.py:222
↓ 2 callers
Method
decode
(self, t: List[int])
codes/tokenization_chatglm.py:61
↓ 2 callers
Function
main
()
codes/main.py:78
↓ 1 callers
Method
__init__
(self, model_path: str)
codes/tokenization_chatglm.py:15
↓ 1 callers
Method
_convert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
codes/tokenization_chatglm.py:183
↓ 1 callers
Method
convert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
codes/tokenization_chatglm.py:85
↓ 1 callers
Method
convert_token_to_id
Converts a token (str) in an id using the vocab.
codes/tokenization_chatglm.py:79
↓ 1 callers
Method
decode_tokens
(self, tokens: List[str])
codes/tokenization_chatglm.py:75
↓ 1 callers
Method
evaluate
Run evaluation and returns metrics. The calling script will be responsible for providing a method to compute metrics, as they are ta
codes/trainer_seq2seq.py:31
↓ 1 callers
Function
get_args
()
codes/data_preprocess.py:7
↓ 1 callers
Method
get_prefix_tokens
(self)
codes/tokenization_chatglm.py:218
↓ 1 callers
Method
get_text_sequence_effective_length
(self, tensor: list)
codes/data_collator.py:7
↓ 1 callers
Method
predict
Run prediction and returns predictions and potential metrics. Depending on the dataset and your use case, your test dataset may cont
codes/trainer_seq2seq.py:80
↓ 1 callers
Method
tokenize
(self, s: str, encode_special_tokens=False)
codes/tokenization_chatglm.py:37
Method
__call__
(self, features, return_tensors=None)
codes/data_collator.py:19
Method
__init__
( self, vocab_file, padding_side="left", clean_up_tokenization_spaces=False,
codes/tokenization_chatglm.py:99
Method
__init__
(self, *args, save_changed=False, **kwargs)
codes/trainer.py:33
Method
__post_init__
(self)
codes/arguments.py:213
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
codes/tokenization_chatglm.py:179
Function
_mp_fn
(index)
codes/main.py:645
Method
_pad
Pad encoded inputs (on left/right and up to predefined length or max length in the batch) Args: encoded_inputs:
codes/tokenization_chatglm.py:276
Method
_save
(self, output_dir: Optional[str] = None, state_dict=None)
codes/trainer.py:37
Method
_tokenize
(self, text, **kwargs)
codes/tokenization_chatglm.py:176
Function
build_chat_input
(tokenizer, query, prompt: str, history=None, role="user")
codes/main.py:62
Method
build_chat_input
(self, query, history=None, role="user")
codes/tokenization_chatglm.py:238
Method
build_inputs_with_special_tokens
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and adding special tokens
codes/tokenization_chatglm.py:251
Function
build_qa_prompt
(query: str)
codes/main.py:54
Function
compute_metrics
(eval_preds)
codes/main.py:490
Method
convert_tokens_to_string
(self, tokens: List[str])
codes/tokenization_chatglm.py:187
Method
eos_token
(self)
codes/tokenization_chatglm.py:139
Method
eos_token_id
(self)
codes/tokenization_chatglm.py:151
Method
get_vocab
Returns vocab as a dict
codes/tokenization_chatglm.py:170
Method
pad_token
(self)
codes/tokenization_chatglm.py:135
Method
pad_token_id
(self)
codes/tokenization_chatglm.py:147
Method
prediction_step
Perform an evaluation step on `model` using `inputs`. Subclass and override to inject custom behavior. Args: mo
codes/trainer_seq2seq.py:138
Function
preprocess_function_eval
(examples)
codes/main.py:221
Function
preprocess_function_train
(examples)
codes/main.py:276
Function
preprocess_function_train_problem_solving
(examples)
codes/main.py:327
Method
save_vocabulary
Save the vocabulary and special tokens file to a directory. Args: save_directory (`str`): The directory
codes/tokenization_chatglm.py:190
Method
unk_token
(self)
codes/tokenization_chatglm.py:131
Method
unk_token_id
(self)
codes/tokenization_chatglm.py:143