pre commits

This commit is contained in:
Sotirios Anagnostidis
2023-01-06 22:09:24 +01:00
parent fb3266b759
commit d3952354e2
7 changed files with 106 additions and 65 deletions
@@ -1,5 +1,6 @@
from transformers import AutoModelForCausalLM
from .gptj import get_model as get_gptj_model
# from .gptj import get_model as get_gptj_model
SUPPORTED_MODELS = ["galactica", "gpt-j"]
@@ -25,7 +26,8 @@ def freeze_top_n_layers(model, target_layers):
def get_specific_model(model_name, cache_dir, quantization):
if "gpt-j" in model_name.lower():
return get_gptj_model(model_name, cache_dir, quantization)
else:
return AutoModelForCausalLM.from_pretrained(model_name, cache_dir=cache_dir)
return AutoModelForCausalLM.from_pretrained(model_name, cache_dir=cache_dir)
# if "gpt-j" in model_name.lower():
# return get_gptj_model(model_name, cache_dir, quantization)
# else:
# return AutoModelForCausalLM.from_pretrained(model_name, cache_dir=cache_dir)