SYMBOL INDEX (96 symbols across 15 files) FILE: scripts/ceval/eval.py function main (line 13) | def main(args, evaluator,take): FILE: scripts/ceval/evaluator.py class Evaluator (line 4) | class Evaluator: method __init__ (line 5) | def __init__(self, choices, model_name, k=-1): method format_example (line 11) | def format_example(self, line, include_answer=True): method generate_few_shot_prompt (line 20) | def generate_few_shot_prompt(self, subject, dev_df): method eval_subject (line 29) | def eval_subject(self, subject_name, test_df, dev_df=None, few_shot=Fa... method normalize_answer (line 32) | def normalize_answer(self,s): method exact_match (line 46) | def exact_match(self,pred, target): FILE: scripts/ceval/llama_evaluator.py class Llama_Evaluator (line 12) | class Llama_Evaluator(Evaluator): method __init__ (line 13) | def __init__(self, choices, k, model_path, device, temperature=0.2): method eval_subject (line 45) | def eval_subject(self, subject_name, method format_example (line 131) | def format_example(self, line, include_answer=True, cot=False, with_pr... method generate_few_shot_prompt (line 154) | def generate_few_shot_prompt(self, subject, dev_df, cot=False): method extract_answer (line 167) | def extract_answer(self, line, gen_ans): FILE: scripts/crawl_prompt.py function return_random_prompt (line 9) | def return_random_prompt(): FILE: scripts/inference/gradio_demo.py function setup (line 73) | def setup(): function reset_user_input (line 124) | def reset_user_input(): function reset_state (line 129) | def reset_state(): function generate_prompt (line 134) | def generate_prompt(instruction): function user (line 142) | def user(user_message, history): class Stream (line 147) | class Stream(StoppingCriteria): method __init__ (line 148) | def __init__(self, callback_func=None): method __call__ (line 151) | def __call__(self, input_ids, scores) -> bool: class Iteratorize (line 157) | class Iteratorize: method __init__ (line 164) | def __init__(self, func, kwargs=None, callback=None): method __iter__ (line 193) | def __iter__(self): method __next__ (line 196) | def __next__(self): method __del__ (line 203) | def __del__(self): method __enter__ (line 206) | def __enter__(self): method __exit__ (line 209) | def __exit__(self, exc_type, exc_val, exc_tb): function clear_torch_cache (line 214) | def clear_torch_cache(): function predict (line 222) | def predict( FILE: scripts/inference/inference_hf.py function generate_prompt (line 50) | def generate_prompt(instruction, input=None): FILE: scripts/inference/patches.py function apply_rotary_pos_emb_single (line 22) | def apply_rotary_pos_emb_single(q, cos, sin, position_ids): function xformers_forward (line 32) | def xformers_forward( function adaptive_ntk_init (line 126) | def adaptive_ntk_init(self, dim, max_position_embeddings=2048, base=1000... function adaptive_ntk_forward (line 140) | def adaptive_ntk_forward(self, x, seq_len=None): function apply_attention_patch (line 175) | def apply_attention_patch( function apply_ntk_scaling_patch (line 188) | def apply_ntk_scaling_patch(alpha: Union[float,str]): FILE: scripts/merge_llama_with_chinese_lora.py function transpose (line 77) | def transpose(weight, fan_in_fan_out): function translate_state_dict_key (line 81) | def translate_state_dict_key(k): function unpermute (line 119) | def unpermute(w): function save_shards (line 125) | def save_shards(model_sd, num_shards: int): FILE: scripts/merge_llama_with_chinese_lora_low_mem.py function transpose (line 79) | def transpose(weight, fan_in_fan_out): function translate_state_dict_key (line 83) | def translate_state_dict_key(k): function unpermute (line 121) | def unpermute(w): function save_shards (line 127) | def save_shards(model_sd, num_shards: int, prefix="", verbose=False): function merge_shards (line 203) | def merge_shards(output_dir, num_shards: int): FILE: scripts/openai_server_demo/openai_api_protocol.py class ChatCompletionRequest (line 8) | class ChatCompletionRequest(BaseModel): class ChatMessage (line 24) | class ChatMessage(BaseModel): class ChatCompletionResponseChoice (line 29) | class ChatCompletionResponseChoice(BaseModel): class ChatCompletionResponse (line 34) | class ChatCompletionResponse(BaseModel): class EmbeddingsRequest (line 42) | class EmbeddingsRequest(BaseModel): class EmbeddingsResponse (line 47) | class EmbeddingsResponse(BaseModel): class CompletionRequest (line 53) | class CompletionRequest(BaseModel): class CompletionResponseChoice (line 70) | class CompletionResponseChoice(BaseModel): class CompletionResponse (line 75) | class CompletionResponse(BaseModel): FILE: scripts/openai_server_demo/openai_api_server.py function generate_completion_prompt (line 79) | def generate_completion_prompt(instruction: str): function generate_chat_prompt (line 88) | def generate_chat_prompt(messages: list): function predict (line 105) | def predict( function get_embedding (line 149) | def get_embedding(input): function create_chat_completion (line 175) | async def create_chat_completion(request: ChatCompletionRequest): function create_completion (line 197) | async def create_completion(request: CompletionRequest): function create_embeddings (line 213) | async def create_embeddings(request: EmbeddingsRequest): FILE: scripts/openai_server_demo/patches.py function apply_rotary_pos_emb_single (line 22) | def apply_rotary_pos_emb_single(q, cos, sin, position_ids): function xformers_forward (line 32) | def xformers_forward( function adaptive_ntk_init (line 126) | def adaptive_ntk_init(self, dim, max_position_embeddings=2048, base=1000... function adaptive_ntk_forward (line 140) | def adaptive_ntk_forward(self, x, seq_len=None): function apply_attention_patch (line 175) | def apply_attention_patch( function apply_ntk_scaling_patch (line 188) | def apply_ntk_scaling_patch(alpha: Union[float,str]): FILE: scripts/training/build_dataset.py function build_instruction_dataset (line 21) | def build_instruction_dataset(data_path: Union[List[str],str], class DataCollatorForSupervisedDataset (line 89) | class DataCollatorForSupervisedDataset(object): method __call__ (line 94) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: FILE: scripts/training/run_clm_pt_with_peft.py class SavePeftModelCallback (line 62) | class SavePeftModelCallback(transformers.TrainerCallback): method save_model (line 63) | def save_model(self, args, state, kwargs): method on_save (line 73) | def on_save(self, args, state, control, **kwargs): method on_train_end (line 77) | def on_train_end(self, args, state, control, **kwargs): function accuracy (line 83) | def accuracy(predictions, references, normalize=True, sample_weight=None): function compute_metrics (line 91) | def compute_metrics(eval_preds): function preprocess_logits_for_metrics (line 100) | def preprocess_logits_for_metrics(logits, labels): function fault_tolerance_data_collator (line 108) | def fault_tolerance_data_collator(features: List) -> Dict[str, Any]: class ModelArguments (line 158) | class ModelArguments: method __post_init__ (line 230) | def __post_init__(self): class DataTrainingArguments (line 238) | class DataTrainingArguments: method __post_init__ (line 301) | def __post_init__(self): class MyTrainingArguments (line 307) | class MyTrainingArguments(TrainingArguments): function main (line 320) | def main(): FILE: scripts/training/run_clm_sft_with_peft.py class SavePeftModelCallback (line 63) | class SavePeftModelCallback(transformers.TrainerCallback): method save_model (line 64) | def save_model(self, args, state, kwargs): method on_save (line 74) | def on_save(self, args, state, control, **kwargs): method on_train_end (line 78) | def on_train_end(self, args, state, control, **kwargs): class ModelArguments (line 85) | class ModelArguments: method __post_init__ (line 154) | def __post_init__(self): class DataTrainingArguments (line 162) | class DataTrainingArguments: class MyTrainingArguments (line 199) | class MyTrainingArguments(TrainingArguments): function main (line 212) | def main():