Skip to content

Commit

Permalink
Fix pptx (#388)
Browse files Browse the repository at this point in the history
* Fix timeout

* Fix guardrail config

* Fix pptx deps

* Fix Display Imaage Button (#389)

---------

Co-authored-by: wwxxzz <zxw320697@alibaba-inc.com>
  • Loading branch information
moria97 and wwxxzz authored Feb 17, 2025
1 parent ddbc0be commit 9146f0e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV VIRTUAL_ENV=/app/.venv \
ENABLE_AIOHTTPCLIENT=false \
ENABLE_HTTPX=false

RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 libgomp1 curl
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 libgomp1 curl libgdiplus

# setup paddleocr dependencies
RUN mkdir -p /root/.paddleocr/whl/det/ch/ch_PP-OCRv4_det_infer \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ENV VIRTUAL_ENV=/app/.venv \
ENABLE_AIOHTTPCLIENT=false \
ENABLE_HTTPX=false

RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 libgomp1 curl
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 libgomp1 curl libgdiplus

# setup paddleocr dependencies
RUN mkdir -p /root/.paddleocr/whl/det/ch/ch_PP-OCRv4_det_infer \
Expand Down
1 change: 1 addition & 0 deletions src/pai_rag/app/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ContextDoc(BaseModel):
text: str # 文档文本
score: float # 文档得分
metadata: Dict # 文档元数据
image_url: str | None = None # 图片链接


class RetrievalResponse(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion src/pai_rag/app/web/tabs/chat_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def create_chat_tab() -> Dict[str, Any]:
label="Display Image",
info="Inference with multi-modal LLM.",
elem_id="need_image",
visible=False,
visible=True,
)
default_web_search = gr.Checkbox(
label="Default search web",
Expand Down
7 changes: 6 additions & 1 deletion src/pai_rag/core/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class AliyunTextModerationPlusConfig(BaseModel):
custom_advice: str | None = None

def is_enabled(self) -> bool:
return self.access_key_id is not None and self.access_key_secret is not None
return (
self.access_key_id is not None
and self.access_key_secret is not None
and len(self.access_key_id) > 0
and len(self.access_key_secret) > 0
)


class NodeEnhancementConfig(BaseModel):
Expand Down

0 comments on commit 9146f0e

Please # to comment.