cieske commited on
Commit
1429ca3
1 Parent(s): 7e1cbde

Fix running condition of translate_llama2

Browse files

Function 'translate_llama2' is needed for Llama 2 Family because of there are transformer version(model name ended with "-hf") and torch version, which is useless now due to the models are integrated to one from Llama3 at recent family.

Files changed (1) hide show
  1. src/utils.py +1 -1
src/utils.py CHANGED
@@ -17,7 +17,7 @@ def translate_llama2(text):
17
 
18
  def get_model(model_name: str, library: str, access_token: str):
19
  "Finds and grabs model from the Hub, and initializes on `meta`"
20
- if "meta-llama" in model_name:
21
  model_name = translate_llama2(model_name)
22
  if library == "auto":
23
  library = None
 
17
 
18
  def get_model(model_name: str, library: str, access_token: str):
19
  "Finds and grabs model from the Hub, and initializes on `meta`"
20
+ if "meta-llama" in model_name and "Llama-2" in model_name:
21
  model_name = translate_llama2(model_name)
22
  if library == "auto":
23
  library = None