Skip to content

Commit

Permalink
fix auto plugins error & docker default embeddings (#98)
Browse files Browse the repository at this point in the history
* run with docker compose

* fix: OPENAI_API_BASE default empty

* fix: Adjust the environment variable settings during image build and runtime

* dockerize done

* Update docker instructions

* fix:backend overload

* add default embedding for auto plugin

---------

Co-authored-by: BlankCheng <[email protected]>
  • Loading branch information
go-laoji and BlankCheng authored Nov 22, 2023
1 parent 8e8fb47 commit 7420f9b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@ FROM python:3.10.4-slim
WORKDIR /app
COPY backend ./backend
COPY real_agents ./real_agents
RUN pip install --no-cache-dir -r backend/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple &&\
pip install pyecharts -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN set -eux; \
pip install --no-cache-dir -r backend/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple; \
pip install --no-cache-dir pyecharts -i https://pypi.tuna.tsinghua.edu.cn/simple; \
savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
apt-get install -y --no-install-recommends git; \
git clone https://github.com/xlang-ai/instructor-embedding ; \
cd instructor-embedding ;\
pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple; \
pip install --no-cache-dir InstructorEmbedding; \
cd .. ;\
rm -rf instructor-embedding;\
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

ENV VARIABLE_REGISTER_BACKEND=redis \
MESSAGE_MEMORY_MANAGER_BACKEND=database \
JUPYTER_KERNEL_MEMORY_MANAGER_BACKEND=database \
Expand Down
2 changes: 1 addition & 1 deletion backend/api/chat_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def chat_xlang_plugin() -> Dict:
user_intent)
selected_plugins = tool_selector.select_tools(query=query, top_k=5)
else:
selected_plugins = random.sample(plugins, 5)
selected_plugins = [_plugin['id'] for _plugin in random.sample(plugins, 5)]

# Build executor and run chat
stream_handler = AgentStreamingStdOutCallbackHandler()
Expand Down

0 comments on commit 7420f9b

Please sign in to comment.