Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SeungyounShin/Llama2-Code-Interpreter
/ functions
Functions
94 in github.com/SeungyounShin/Llama2-Code-Interpreter
⨍
Functions
94
◇
Types & classes
17
↓ 5 callers
Method
add_and_run
(self, code_string)
code_interpreter/JuypyterClient.py:27
↓ 5 callers
Method
execute_code_and_return_output
(self, code_str: str)
code_interpreter/BaseCodeInterpreter.py:57
↓ 5 callers
Method
extract_code_blocks
(text: str)
code_interpreter/BaseCodeInterpreter.py:48
↓ 4 callers
Function
get_embedding
(text, model="text-embedding-ada-002")
code_interpreter/RetrospectiveGPTCodeInterpreter.py:67
↓ 4 callers
Function
permute
(w, n_heads=n_heads, dim1=dim, dim2=dim)
utils/convert_llama_weights_to_hf.py:119
↓ 3 callers
Function
change_markdown_image
(text: str)
chatbot.py:97
↓ 3 callers
Method
chat
( self, user_message: str, VERBOSE: bool = False, MAX_TRY: int = 6, co
code_interpreter/GPTCodeInterpreter.py:116
↓ 3 callers
Method
generate
( self, prompt: str = "[INST]\n###User : hi\n###Assistant :", max_new_tokens=512,
chatbot.py:51
↓ 3 callers
Function
msg_to_code_result_tok_temp
(msg: List[Dict])
finetuning/conversation_template.py:29
↓ 2 callers
Method
chat
(self, user_message: str, VERBOSE: bool = False, MAX_TRY=5)
code_interpreter/LlamaCodeInterpreter.py:174
↓ 2 callers
Method
clean_code_output
(self, output: str)
code_interpreter/LlamaCodeInterpreter.py:164
↓ 2 callers
Method
dialog_to_prompt
(self, dialog: List[Dict])
code_interpreter/LlamaCodeInterpreter.py:108
↓ 2 callers
Method
extract_code_blocks
(self, prompt: str)
code_interpreter/LlamaCodeInterpreter.py:154
↓ 2 callers
Function
find_all_sublist_end
Find all the ending indices of a sublist in a main list.
finetuning/train.py:111
↓ 2 callers
Function
find_all_sublist_start
Find all the starting indices of a sublist in a main list.
finetuning/train.py:122
↓ 2 callers
Method
generate
( self, prompt: str = "[INST]\n###User : hi\n###Assistant :", max_new_tokens=512,
code_interpreter/LlamaCodeInterpreter.py:114
↓ 2 callers
Function
get_error_header
(traceback_str)
utils/cleaner.py:5
↓ 2 callers
Function
json_to_code_result_tok_temp
(json_file_name: str = "425.json")
finetuning/conversation_template.py:68
↓ 1 callers
Method
ChatCompletion
(self)
code_interpreter/GPTCodeInterpreterDataCollect.py:136
↓ 1 callers
Method
ChatCompletion
(self)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:205
↓ 1 callers
Method
ChatCompletion
(self)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:277
↓ 1 callers
Method
ChatCompletion
(self)
code_interpreter/GPTCodeInterpreter.py:97
↓ 1 callers
Function
_tokenize_fn
Tokenize a list of strings.
finetuning/train.py:85
↓ 1 callers
Function
build_model_from_hf_path
( hf_model_path: str = "./ckpt/llama-2-13b-chat", peft: bool = False )
finetuning/train.py:246
↓ 1 callers
Function
build_model_from_hf_path
( hf_base_model_path: str = "./ckpt/llama-2-13b-chat", load_peft: Optional[bool] = False, peft_mod
eval/inference.py:84
↓ 1 callers
Method
chat
(self, user_message: str, VERBOSE: bool = False, MAX_RETRY: int = 6)
code_interpreter/GPTCodeInterpreterDataCollect.py:144
↓ 1 callers
Method
chat
( self, user_message: str, VERBOSE: bool = False, MAX_TRY: int = 6, co
code_interpreter/RetrospectiveGPTCodeInterpreter.py:296
↓ 1 callers
Method
clean_output
(self, outputs)
code_interpreter/JuypyterClient.py:12
↓ 1 callers
Function
clean_the_dialog
(dialog, question)
code_interpreter/GPTCodeInterpreterDataCollect.py:77
↓ 1 callers
Function
clean_the_dialog
(dialog, question)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:43
↓ 1 callers
Function
clean_the_dialog
(dialog, question)
code_interpreter/GPTCodeInterpreter.py:39
↓ 1 callers
Method
close
Shutdown the kernel.
code_interpreter/JuypyterClient.py:73
↓ 1 callers
Function
compute_intermediate_size
(n, ffn_dim_multiplier=1, multiple_of=256)
utils/convert_llama_weights_to_hf.py:75
↓ 1 callers
Function
create_peft_config
(model)
finetuning/train.py:60
↓ 1 callers
Function
delete_print_asser
(code_text: str)
eval/human_eval.py:61
↓ 1 callers
Function
exec_with_timeout
(import_str, full_test_code)
eval/human_eval.py:153
↓ 1 callers
Function
extract_all_code_block
(input_str: str)
eval/human_eval.py:48
↓ 1 callers
Function
extract_all_code_block_gpt
(input_str: str)
eval/human_eval.py:54
↓ 1 callers
Function
extract_text
(prompt, remove_lines=True)
eval/human_eval.py:31
↓ 1 callers
Function
get_error_message
(traceback_str)
utils/check_nb_plot_img_out.py:8
↓ 1 callers
Function
get_last_outermost_function_name
(function_str)
eval/human_eval.py:106
↓ 1 callers
Method
get_response_content
(self)
code_interpreter/GPTCodeInterpreterDataCollect.py:125
↓ 1 callers
Method
get_response_content
(self)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:266
↓ 1 callers
Method
get_response_content
(self)
code_interpreter/GPTCodeInterpreter.py:86
↓ 1 callers
Function
gradio_launch
(model_path: str, load_in_4bit: bool = True, MAX_TRY: int = 5)
chatbot.py:102
↓ 1 callers
Function
inference
( user_input="What is 100th fibo num?", max_new_tokens=512, do_sample: bool = True, use_cache:
eval/inference.py:148
↓ 1 callers
Function
load_jsonl
(file_path, num_lines_to_display=5)
eval/gsm8k.py:10
↓ 1 callers
Function
main
()
utils/convert_llama_weights_to_hf.py:332
↓ 1 callers
Function
make_supervised_data_module
Make dataset and collator for supervised fine-tuning.
finetuning/train.py:233
↓ 1 callers
Function
preprocess
( trajs: Sequence[str], tokenizer: transformers.PreTrainedTokenizer, )
finetuning/train.py:133
↓ 1 callers
Function
read_json
(path)
utils/convert_llama_weights_to_hf.py:81
↓ 1 callers
Function
remove_string
(s)
code_interpreter/GPTCodeInterpreterDataCollect.py:31
↓ 1 callers
Function
remove_string
(s)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:38
↓ 1 callers
Function
remove_string
(s)
code_interpreter/GPTCodeInterpreter.py:34
↓ 1 callers
Function
save_dialog
(dialog, base_path: str = f"{prj_root_path}/gpt_data_gen")
code_interpreter/GPTCodeInterpreterDataCollect.py:58
↓ 1 callers
Method
save_dialog
(self, path: str = "./output/dialog.json")
code_interpreter/GPTCodeInterpreter.py:111
↓ 1 callers
Method
save_embeddings
(self)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:128
↓ 1 callers
Method
save_embeddings
(self)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:213
↓ 1 callers
Function
train
()
finetuning/train.py:307
↓ 1 callers
Function
write_json
(text, path)
utils/convert_llama_weights_to_hf.py:86
↓ 1 callers
Function
write_model
(model_path, input_base_path, model_size, safe_serialization=True)
utils/convert_llama_weights_to_hf.py:91
↓ 1 callers
Function
write_tokenizer
(tokenizer_path, input_tokenizer_path)
utils/convert_llama_weights_to_hf.py:322
Method
__call__
(self, instances: Sequence[Dict])
finetuning/train.py:216
Method
__call__
(self, query, top_k=3, VERBOSE: bool = False)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:131
Method
__call__
(self, query, top_k=3, VERBOSE: bool = False)
code_interpreter/RetrospectiveGPTCodeInterpreter.py:216
Method
__getitem__
(self, i)
finetuning/train.py:206
Method
__init__
(self, data_path: str, tokenizer: transformers.PreTrainedTokenizer)
finetuning/train.py:187
Method
__init__
(self, config)
finetuning/codellama_wrapper.py:11
Method
__init__
(self, model="gpt-4")
code_interpreter/GPTCodeInterpreterDataCollect.py:97
Method
__init__
( self, data_directory="./gpt_data_gen_retrospect/", embeddings_path="./gpt_data_gen_r
code_interpreter/RetrospectiveGPTCodeInterpreter.py:86
Method
__init__
( self, model="gpt-4", data_directory="./eval/gpt_mbpp_output", embeddings_pat
code_interpreter/RetrospectiveGPTCodeInterpreter.py:139
Method
__init__
(self, model="gpt-4")
code_interpreter/RetrospectiveGPTCodeInterpreter.py:236
Method
__init__
( self, model_path: str, load_in_8bit: bool = False, load_in_4bit: bool = Fals
code_interpreter/LlamaCodeInterpreter.py:48
Method
__init__
(self)
code_interpreter/JuypyterClient.py:7
Method
__init__
(self)
code_interpreter/BaseCodeInterpreter.py:35
Method
__init__
(self, model="gpt-4")
code_interpreter/GPTCodeInterpreter.py:59
Method
__len__
(self)
finetuning/train.py:203
Function
bot
(history)
chatbot.py:112
Function
build_model_from_hf_path
( hf_base_model_path: str = "./ckpt/llama-2-13b-chat", load_peft: Optional[bool] = False, peft_mod
code_interpreter/llama_hf.py:52
Function
clean_error_msg
(error_str:str ='')
utils/cleaner.py:12
Method
close
close jupyter notebook, and this class instance
code_interpreter/RetrospectiveGPTCodeInterpreter.py:290
Method
close
close jupyter notebook, and this class instance
code_interpreter/GPTCodeInterpreter.py:105
Function
create_peft_config
(model)
eval/inference.py:60
Function
create_peft_config
(model)
code_interpreter/llama_hf.py:28
Function
extract_function_from_code_block
(code_block: str)
eval/human_eval.py:73
Function
extract_test_assertion
(test_func: str)
eval/human_eval.py:136
Function
gen_questions
(prefix="What is 55th fibonacci number?")
code_interpreter/GPTCodeInterpreterDataCollect.py:36
Function
get_function_name
(function_str)
eval/human_eval.py:128
Function
get_last_function_name
(function_str)
eval/human_eval.py:113
Function
get_outermost_function_name
(function_str)
eval/human_eval.py:121
Method
parse_last_answer
(text: str)
code_interpreter/BaseCodeInterpreter.py:54
Method
run_code_in_thread
()
code_interpreter/JuypyterClient.py:29
Method
save_dialog
(self, path: str = "./output/dialog.json")
code_interpreter/RetrospectiveGPTCodeInterpreter.py:285
Function
user
(user_message, history)
chatbot.py:213