Skip to content

Commit

Permalink
doc: update installation and dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
chenweize1998 committed Oct 30, 2023
1 parent f0ddd0e commit 8ad97cb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,20 @@ https://github.com/OpenBMB/AgentVerse/assets/11704492/4d07da68-f942-4205-b558-f1

## Installation


**Manually Install (Recommended!)**

**Make sure you have Python >= 3.9**
```bash
git clone https://github.com/OpenBMB/AgentVerse.git --depth 1
cd AgentVerse
python setup.py develop
pip install -e .
```

If you want to use AgentVerse with local models such as LLaMA, you need to additionally install some other dependencies:
```bash
pip install -r requirements_local.txt
```
Some users have reported problems installing the `orjson` required by `gradio`. One simple workaround is to install it with Anaconda `conda install -c conda-forge orjson`.

**Install with pip**

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 @@ -5,7 +5,6 @@
from agentverse.logging import logger
from agentverse.message import Message
from agentverse.llms import LOCAL_LLMS
from transformers import AutoTokenizer


def count_string_tokens(prompt: str = "", model: str = "gpt-3.5-turbo") -> int:
Expand All @@ -29,6 +28,7 @@ def count_message_tokens(
tokens_per_name = 1
encoding_model = "gpt-4"
elif model in LOCAL_LLMS:
from transformers import AutoTokenizer
encoding = AutoTokenizer.from_pretrained(model)
else:
raise NotImplementedError(
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pyyaml
fastapi==0.95.1
uvicorn
py3langid
iso-639
setuptools-scm
openai==0.27.8
opencv-python==4.8.0.76
gradio
Expand All @@ -17,5 +17,4 @@ colorlog
rapidfuzz
spacy
colorama==0.4.6
fschat[model_worker,webui]
tiktoken==0.5.1
1 change: 1 addition & 0 deletions requirements_local.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fschat[model_worker,webui]
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
with open("requirements.txt", "r") as f:
requirements = f.read().splitlines()

with open("requirements_local.txt", "r") as f:
requirements_local = f.read().splitlines()

with open("README.md", "r", encoding='utf8') as fh:
long_description = fh.read()

Expand Down Expand Up @@ -38,6 +41,9 @@
# "langchain",
# ],
install_requires=requirements,
extras_require={
'local': requirements_local
},
include_package_data = True,
entry_points={
"console_scripts": [
Expand Down

0 comments on commit 8ad97cb

Please sign in to comment.