Skip to content

Commit

Permalink
Fix multi_modal build docker (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
moria97 authored Aug 30, 2024
1 parent b2b023b commit 7883adf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV POETRY_NO_INTERACTION=1 \
WORKDIR /app
COPY . .

RUN poetry install && rm -rf $POETRY_CACHE_DIR
RUN poetry install && poetry run pip install git+https://github.com/facebookresearch/detectron2.git && rm -rf $POETRY_CACHE_DIR

FROM python:3.11-slim AS prod

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY . .
RUN mv pyproject_gpu.toml pyproject.toml \
&& rm poetry.lock

RUN poetry install && rm -rf $POETRY_CACHE_DIR
RUN poetry install && poetry run pip install git+https://github.com/facebookresearch/detectron2.git && rm -rf $POETRY_CACHE_DIR

FROM python:3.11-slim AS prod

Expand Down
6 changes: 4 additions & 2 deletions src/pai_rag/modules/llm/multi_modal_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ def _create_new_instance(self, new_params: Dict[str, Any]):
if llm_config.source.lower() == "dashscope":
logger.info("Using DashScope Multi-Modal-LLM.")
return OpenAIAlikeMultiModal(
model="qwen-vl-max",
model=llm_config.get("model_name", "qwen-vl-max"),
api_base=DEFAULT_DASHSCOPE_API_BASE,
api_key=os.environ.get("DASHSCOPE_API_KEY"),
)
elif llm_config.source.lower() == "paieas" and llm_config.get("endpoint"):
logger.info("Using PAI-EAS Multi-Modal-LLM.")
return OpenAIAlikeMultiModal(
model="/model_repository/MiniCPM-V-2_6", # TODO: change model path
model=llm_config.get(
"model_name", "/model_repository/MiniCPM-V-2_6"
), # TODO: change model path
api_base=llm_config.endpoint,
api_key=llm_config.token,
)
Expand Down

0 comments on commit 7883adf

Please # to comment.