Skip to content

Commit

Permalink
Only catch not implemented error
Browse files Browse the repository at this point in the history
  • Loading branch information
BeibinLi authored Jul 29, 2024
1 parent a40aa56 commit c27f0a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autogen/oai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def create(self, params: Dict[str, Any]) -> ChatCompletion:
model = chunk.model.replace("gpt-35", "gpt-3.5") # hack for Azure API
try:
prompt_tokens = count_token(params["messages"], model)
except Exception as e:
except NotImplementedError as e:
# Catch token calculation error if streaming with customized models.
logger.warning(str(e))
prompt_tokens = 0
Expand Down

0 comments on commit c27f0a9

Please sign in to comment.