Skip to content

Commit

Permalink
resolve circular import bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chenweize1998 committed Oct 27, 2023
1 parent e66249c commit df3e875
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions agentverse/llms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from agentverse.registry import Registry

llm_registry = Registry(name="LLMRegistry")
LOCAL_LLMS = ["llama-2-7b-chat-hf"]

from .base import BaseLLM, BaseChatModel, BaseCompletionModel, LLMResult
from .openai import OpenAIChat
6 changes: 2 additions & 4 deletions agentverse/llms/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from agentverse.logging import logger
from agentverse.message import Message

from . import llm_registry
from . import llm_registry, LOCAL_LLMS
from .base import BaseChatModel, BaseCompletionModel, BaseModelArgs
from .utils.jsonrepair import JsonRepair

Expand Down Expand Up @@ -92,10 +92,8 @@ class OpenAIChatArgs(BaseModelArgs):
# total_tokens=response["usage"]["total_tokens"],
# )

# To support your own local LLMs, register it here and add it into LOCAL_LLMS.
LOCAL_LLMS = ["llama-2-7b-chat-hf"]


# To support your own local LLMs, register it here and add it into LOCAL_LLMS.
@llm_registry.register("gpt-35-turbo")
@llm_registry.register("gpt-3.5-turbo")
@llm_registry.register("gpt-4")
Expand Down
2 changes: 1 addition & 1 deletion agentverse/llms/utils/token_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import List, Union, Dict
from agentverse.logging import logger
from agentverse.message import Message
from agentverse.llms.openai import LOCAL_LLMS
from agentverse.llms import LOCAL_LLMS
from transformers import AutoTokenizer


Expand Down

0 comments on commit df3e875

Please sign in to comment.