Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Kent0n-Li/ChatDoctor
/ functions
Functions
29 in github.com/Kent0n-Li/ChatDoctor
⨍
Functions
29
◇
Types & classes
6
↓ 2 callers
Function
generate_prompt
(data_point)
train_lora.py:297
↓ 2 callers
Function
tokenize
(prompt, add_eos_token=True)
train_lora.py:140
↓ 1 callers
Function
_make_r_io_base
(f, mode: str)
utils.py:143
↓ 1 callers
Function
_make_w_io_base
(f, mode: str)
utils.py:134
↓ 1 callers
Function
_tokenize_fn
Tokenize a list of strings.
train.py:98
↓ 1 callers
Function
csv_prompter
(question,csv_name)
Autonomous_ChatGPT_API/chat_openai.py:12
↓ 1 callers
Function
csv_prompter
(generator, tokenizer, question)
Autonomous_ChatDoctor_csv/csv_reader.py:8
↓ 1 callers
Function
divide_string
(wiki_page, word_limit=50)
Autonomous_ChatDoctor_Wikipedia/wiki_reader.py:5
↓ 1 callers
Function
go
()
chat.py:50
↓ 1 callers
Function
go
()
Autonomous_ChatDoctor_Wikipedia/chat_wiki.py:49
↓ 1 callers
Function
go
()
Autonomous_ChatDoctor_csv/chat_csv.py:51
↓ 1 callers
Function
load_model
(model_name, eight_bit=0, device_map="auto")
chat.py:15
↓ 1 callers
Function
load_model
(model_name, eight_bit=0, device_map="auto")
Autonomous_ChatDoctor_Wikipedia/chat_wiki.py:16
↓ 1 callers
Function
load_model
(model_name, eight_bit=0, device_map="auto")
Autonomous_ChatDoctor_csv/chat_csv.py:16
↓ 1 callers
Function
make_supervised_data_module
Make dataset and collator for supervised fine-tuning.
train.py:185
↓ 1 callers
Function
preprocess
Preprocess the data by tokenizing.
train.py:122
↓ 1 callers
Function
safe_save_model_for_hf_trainer
Collects the state dict and dump to disk.
train.py:66
↓ 1 callers
Function
smart_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 callers
Function
train
()
train.py:192
↓ 1 callers
Function
wiki_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
Function
generate_and_tokenize_prompt
(data_point)
train_lora.py:162
Function
jdump
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
Function
jload
Load a .json file into a dictionary.
utils.py:169
Function
openai_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
Function
train
( # model/data params base_model: str = "", # the only required argument data_path: s
train_lora.py:27