MCPcopy Create free account

hub / github.com/Kent0n-Li/ChatDoctor / functions

Functions29 in github.com/Kent0n-Li/ChatDoctor

↓ 2 callersFunctiongenerate_prompt
(data_point)
train_lora.py:297
↓ 2 callersFunctiontokenize
(prompt, add_eos_token=True)
train_lora.py:140
↓ 1 callersFunction_make_r_io_base
(f, mode: str)
utils.py:143
↓ 1 callersFunction_make_w_io_base
(f, mode: str)
utils.py:134
↓ 1 callersFunction_tokenize_fn
Tokenize a list of strings.
train.py:98
↓ 1 callersFunctioncsv_prompter
(question,csv_name)
Autonomous_ChatGPT_API/chat_openai.py:12
↓ 1 callersFunctioncsv_prompter
(generator, tokenizer, question)
Autonomous_ChatDoctor_csv/csv_reader.py:8
↓ 1 callersFunctiondivide_string
(wiki_page, word_limit=50)
Autonomous_ChatDoctor_Wikipedia/wiki_reader.py:5
↓ 1 callersFunctiongo
()
chat.py:50
↓ 1 callersFunctiongo
()
Autonomous_ChatDoctor_Wikipedia/chat_wiki.py:49
↓ 1 callersFunctiongo
()
Autonomous_ChatDoctor_csv/chat_csv.py:51
↓ 1 callersFunctionload_model
(model_name, eight_bit=0, device_map="auto")
chat.py:15
↓ 1 callersFunctionload_model
(model_name, eight_bit=0, device_map="auto")
Autonomous_ChatDoctor_Wikipedia/chat_wiki.py:16
↓ 1 callersFunctionload_model
(model_name, eight_bit=0, device_map="auto")
Autonomous_ChatDoctor_csv/chat_csv.py:16
↓ 1 callersFunctionmake_supervised_data_module
Make dataset and collator for supervised fine-tuning.
train.py:185
↓ 1 callersFunctionpreprocess
Preprocess the data by tokenizing.
train.py:122
↓ 1 callersFunctionsafe_save_model_for_hf_trainer
Collects the state dict and dump to disk.
train.py:66
↓ 1 callersFunctionsmart_tokenizer_and_embedding_resize
Resize tokenizer and embedding. Note: This is the unoptimized version that may make your embedding size not be divisible by 64.
train.py:75
↓ 1 callersFunctiontrain
()
train.py:192
↓ 1 callersFunctionwiki_prompter
(generator,tokenizer,question)
Autonomous_ChatDoctor_Wikipedia/wiki_reader.py:18
Method__call__
(self, instances: Sequence[Dict])
train.py:172
Method__getitem__
(self, i)
train.py:162
Method__init__
(self, data_path: str, tokenizer: transformers.PreTrainedTokenizer)
train.py:140
Method__len__
(self)
train.py:159
Functiongenerate_and_tokenize_prompt
(data_point)
train_lora.py:162
Functionjdump
Dump a str or dictionary to a file in json format. Args: obj: An object to be written. f: A string path to the location on disk.
utils.py:149
Functionjload
Load a .json file into a dictionary.
utils.py:169
Functionopenai_completion
Decode with OpenAI API. Args: prompts: A string or a list of strings to complete. If it is a chat model the strings should be formatted
utils.py:40
Functiontrain
( # model/data params base_model: str = "", # the only required argument data_path: s
train_lora.py:27