Skip to content

Commit f0068df

Browse files
committed
Merge branch 'main' into new_experiments
2 parents 139e55a + f272fbb commit f0068df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/agentlab/llm/llm_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ def get_tokenizer(model_name="gpt-4"):
516516
logging.info(f"Could not find a tokenizer for model {model_name}. Trying HuggingFace.")
517517
try:
518518
return AutoTokenizer.from_pretrained(model_name)
519-
except OSError:
520-
logging.info(f"Could not find a tokenizer for model {model_name}. Defaulting to gpt-4.")
519+
except Exception as e:
520+
logging.info(f"Could not find a tokenizer for model {model_name}: {e} Defaulting to gpt-4.")
521521
return tiktoken.encoding_for_model("gpt-4")
522522

523523

0 commit comments

Comments
 (0)