refactor: fix previous refactors
This commit is contained in:
@@ -83,7 +83,7 @@ def do_inference(cfg, model, tokenizer, prompter="AlpacaPrompter"):
|
|||||||
temperature=0.9,
|
temperature=0.9,
|
||||||
top_p=0.95,
|
top_p=0.95,
|
||||||
top_k=40,
|
top_k=40,
|
||||||
return_DictDefault_in_generate=True,
|
return_dict_in_generate=True,
|
||||||
output_attentions=False,
|
output_attentions=False,
|
||||||
output_hidden_states=False,
|
output_hidden_states=False,
|
||||||
output_scores=False,
|
output_scores=False,
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ class DictDefault(Dict):
|
|||||||
A Dict that returns None instead of returning empty Dict for missing keys.
|
A Dict that returns None instead of returning empty Dict for missing keys.
|
||||||
'''
|
'''
|
||||||
def __missing__(self, key):
|
def __missing__(self, key):
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -184,9 +184,9 @@ def load_model(
|
|||||||
# # https://github.com/HazyResearch/flash-attention/blob/40a25c8ee7465cf547b929cfa2937034e37bfce9/tests/models/test_gpt_neox.py#L12
|
# # https://github.com/HazyResearch/flash-attention/blob/40a25c8ee7465cf547b929cfa2937034e37bfce9/tests/models/test_gpt_neox.py#L12
|
||||||
# # https://github.com/HazyResearch/flash-attention/tree/main/training#model-components
|
# # https://github.com/HazyResearch/flash-attention/tree/main/training#model-components
|
||||||
# # add `**kwargs` to https://github.com/HazyResearch/flash-attention/blob/40a25c8ee7465cf547b929cfa2937034e37bfce9/flash_attn/models/gpt.py#L442
|
# # add `**kwargs` to https://github.com/HazyResearch/flash-attention/blob/40a25c8ee7465cf547b929cfa2937034e37bfce9/flash_attn/models/gpt.py#L442
|
||||||
# from flash_attn.utils.pretrained import state_DictDefault_from_pretrained
|
# from flash_attn.utils.pretrained import state_dict_from_pretrained
|
||||||
# from flash_attn.models.gpt import GPTLMHeadModel
|
# from flash_attn.models.gpt import GPTLMHeadModel
|
||||||
# from flash_attn.models.gpt_neox import remap_state_DictDefault_hf_gpt_neox, gpt_neox_config_to_gpt2_config
|
# from flash_attn.models.gpt_neox import remap_state_dict_hf_gpt_neox, gpt_neox_config_to_gpt2_config
|
||||||
# from transformers import GPTNeoXConfig
|
# from transformers import GPTNeoXConfig
|
||||||
# config = gpt_neox_config_to_gpt2_config(GPTNeoXConfig.from_pretrained(base_model))
|
# config = gpt_neox_config_to_gpt2_config(GPTNeoXConfig.from_pretrained(base_model))
|
||||||
# config.use_flash_attn = True
|
# config.use_flash_attn = True
|
||||||
|
|||||||
Reference in New Issue
Block a user