Skip to content

Commit

Permalink
Fix typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed Nov 4, 2024
1 parent 0d06966 commit 05b0ca4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/agentscope/service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@

def get_help() -> None:
"""Get help message."""
tools = "\n - ".join(__all__)
help_msg = f"The following service are available:\n{tools}"

help_msg = "\n - ".join(
["The following services are available:"] + __all__[4:],
)
logger.info(help_msg)


Expand Down
5 changes: 2 additions & 3 deletions src/agentscope/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def count(model_name: str, messages: list[dict[str, str]]) -> int:
model_name (`str`):
The name of the model.
messages (`list[dict[str, str]]`):
The list of messages, each message is a dict with the key 'text'.
A list of dictionaries.
"""
# Type checking
if not isinstance(model_name, str):
Expand Down Expand Up @@ -187,7 +187,7 @@ def count_openai_tokens( # pylint: disable=too-many-branches
f"model {model_name}.",
)

num_tokens = 0
num_tokens = 3 # every reply is primed with <|start|>assistant<|message|>
for message in messages:
num_tokens += tokens_per_message
for key, value in message.items():
Expand All @@ -209,7 +209,6 @@ def count_openai_tokens( # pylint: disable=too-many-branches
if key == "name":
num_tokens += tokens_per_name

num_tokens += 3 # every reply is primed with <|start|>assistant<|message|>
return num_tokens


Expand Down

0 comments on commit 05b0ca4

Please sign in to comment.