InternLM/OpenAOE

openaoe 跑不起来

wingjoezhou opened this issue · 1 comments

python = 3.9

docker 运行出现问题。

[root@g1 OpenAOE]# docker run -p 18710:10099 -v /data/OpenAOE/config-template.yaml:/app/config.yaml opensealion/openaoe:latest
Traceback (most recent call last):
File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/app/openaoe/main.py", line 10, in
from openaoe.backend.api.route_google import router as google
File "/app/openaoe/backend/api/route_google.py", line 4, in
from openaoe.backend.service.service_google import palm_chat_svc
File "/app/openaoe/backend/service/service_google.py", line 1, in
from jsonstreamer import ObjectStreamer
File "/usr/local/lib/python3.9/site-packages/jsonstreamer/init.py", line 9, in
from jsonstreamer.jsonstreamer import JSONStreamer, ObjectStreamer
File "/usr/local/lib/python3.9/site-packages/jsonstreamer/jsonstreamer.py", line 14, in
from .yajl.parse import YajlParser, YajlListener, YajlError
File "/usr/local/lib/python3.9/site-packages/jsonstreamer/yajl/parse.py", line 31, in
yajl = load_lib()
File "/usr/local/lib/python3.9/site-packages/jsonstreamer/yajl/parse.py", line 28, in load_lib
raise OSError('Yajl cannot be found.')
OSError: Yajl cannot be found.

系统内 yajl 和 yajl-dev已经安装

(base) [wing@g1 workspace]$ pip list
Package Version


again 1.2.21
aiohttp 3.9.3
aiosignal 1.3.1
aliyun-python-sdk-core 2.14.0
aliyun-python-sdk-kms 2.16.2
annotated-types 0.6.0
anthropic 0.3.11
anyio 3.7.1
archspec 0.2.1
argcomplete 3.2.2
asyncio 3.4.3
attrs 23.2.0
bardapi 0.1.38
beautifulsoup4 4.12.3
boltons 23.0.0
Brotli 1.0.9
browser-cookie3 0.19.1
cachetools 5.3.2
certifi 2023.11.17
cffi 1.16.0
charset-normalizer 2.0.4
click 8.1.7
colorama 0.4.6
conda 23.11.0
conda-content-trust 0.2.0
conda-libmamba-solver 23.12.0
conda-package-handling 2.2.0
conda_package_streaming 0.9.0
crcmod 1.7
cryptography 41.0.7
deep-translator 1.11.4
distro 1.8.0
fastapi 0.103.0
filelock 3.13.1
frozenlist 1.4.1
fsspec 2024.2.0
google-api-core 2.17.1
google-auth 2.28.1
google-cloud-core 2.4.1
google-cloud-translate 3.15.2
googleapis-common-protos 1.62.0
grpcio 1.62.0
grpcio-status 1.62.0
h11 0.14.0
h2 4.1.0
hpack 4.0.0
httpcore 0.18.0
httpx 0.25.0
huggingface-hub 0.20.3
hyperframe 6.0.1
idna 3.4
jeepney 0.8.0
jmespath 0.10.0
jsonpatch 1.32
jsonpointer 2.1
jsonstreamer 1.3.8
langdetect 1.0.9
libmambapy 1.5.3
lz4 4.3.3
markdown-it-py 3.0.0
mdurl 0.1.2
menuinst 2.0.1
multidict 6.0.5
nvidia-ml-py 12.535.133
nvitop 1.3.2
openai 1.6.1
openaoe 0.0.4
openxlab 0.0.34
oss2 2.17.0
packaging 23.1
pip 23.3.1
pipx 1.4.3
platformdirs 3.10.0
pluggy 1.0.0
proto-plus 1.23.0
protobuf 4.25.3
psutil 5.9.8
pyasn1 0.5.1
pyasn1-modules 0.3.0
pycosat 0.6.6
pycparser 2.21
pycryptodome 3.20.0
pycryptodomex 3.20.0
pydantic 2.4.2
pydantic_core 2.10.1
Pygments 2.17.2
pyOpenSSL 23.2.0
PySocks 1.7.1
pytz 2022.7
PyYAML 6.0.1
requests 2.26.0
rich 13.4.2
rsa 4.9
ruamel.yaml 0.17.21
setuptools 60.2.0
six 1.16.0
slack_sdk 3.26.2
sniffio 1.3.1
soupsieve 2.5
sse-starlette 1.8.2
starlette 0.27.0
termcolor 2.4.0
tokenizers 0.15.2
tqdm 4.65.0
truststore 0.8.0
typing_extensions 4.10.0
urllib3 1.26.18
userpath 1.9.1
uvicorn 0.27.1
websocket-client 0.58.0
wheel 0.41.2
yajl 0.3.5
yarl 1.9.4
zstandard 0.19.0

pip 也安装了。

如果 run by pip

(base) [wing@g1 OpenAOE]$ openaoe -f config-template.yaml
Traceback (most recent call last):
File "/data/miniconda3/bin/openaoe", line 5, in
from openaoe.main import main
File "/data/miniconda3/lib/python3.11/site-packages/openaoe/main.py", line 10, in
from openaoe.backend.api.route_google import router as google
File "/data/miniconda3/lib/python3.11/site-packages/openaoe/backend/api/route_google.py", line 4, in
from openaoe.backend.service.service_google import palm_chat_svc
File "/data/miniconda3/lib/python3.11/site-packages/openaoe/backend/service/service_google.py", line 1, in
from jsonstreamer import ObjectStreamer
File "/data/miniconda3/lib/python3.11/site-packages/jsonstreamer/init.py", line 9, in
from jsonstreamer.jsonstreamer import JSONStreamer, ObjectStreamer
File "/data/miniconda3/lib/python3.11/site-packages/jsonstreamer/jsonstreamer.py", line 12, in
from again import events
File "/data/miniconda3/lib/python3.11/site-packages/again/init.py", line 4, in
from .events import EventSource, AsyncEventSource
File "/data/miniconda3/lib/python3.11/site-packages/again/events.py", line 42, in
class AsyncEventSource(ListenerRegister):
File "/data/miniconda3/lib/python3.11/site-packages/again/events.py", line 46, in AsyncEventSource
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?

asyncio 3.4.3

请问是什么问题?

要改源码的 asynvio 方法?

该问题是由于是系统缺少yajl底层库,
The root cause is your system misses the yajl library.

yaji依赖底层库,请按照下面的方式安装:
Yaji depends on some bottom so libraries, please install it as the following instruction:

To install the Yajl (Yet Another JSON Library) tools on a Linux system, you can use the package management tools provided by your Linux distribution. Here's how you can do it on different distributions:

For Ubuntu 22.04, you can use either of the following commands:

Using apt-get:

sudo apt-get update
sudo apt-get -y install yajl-tools

Using apt:

sudo apt update
sudo apt -y install yajl-tools

For CentOS 8, you can use either dnf or yum as follows:

Using dnf:

sudo dnf makecache --refresh
sudo dnf -y install yajl

Using yum:

sudo yum makecache --refresh
sudo yum -y install yajl

And for the docker-way, I have added the yajl library into the image.