瀏覽代碼

fix docker and ollama

damaoooo 10 月之前
父節點
當前提交
52e5129cc1
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Dockerfile
  2. 1 1
      pdf2zh/translator.py

+ 1 - 1
Dockerfile

@@ -15,7 +15,7 @@ ADD "https://github.com/timelic/source-han-serif/releases/download/main/SourceHa
 ADD "https://github.com/timelic/source-han-serif/releases/download/main/SourceHanSerifKR-Regular.ttf" /app/
 
 RUN apt-get update && \
-     apt-get install --no-install-recommends -y libgl1 && \
+     apt-get install --no-install-recommends -y libgl1 libglib2.0-0 && \
      rm -rf /var/lib/apt/lists/* && uv pip install --system --no-cache huggingface-hub && \
      python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download('wybxc/DocLayout-YOLO-DocStructBench-onnx','doclayout_yolo_docstructbench_imgsz1024.onnx');"
 

+ 1 - 1
pdf2zh/translator.py

@@ -274,7 +274,7 @@ class OllamaTranslator(BaseTranslator):
             model = self.envs["OLLAMA_MODEL"]
         super().__init__(lang_in, lang_out, model)
         self.options = {"temperature": 0}  # 随机采样可能会打断公式标记
-        self.client = ollama.Client()
+        self.client = ollama.Client(host=self.envs["OLLAMA_HOST"])
         self.prompttext = prompt
         self.add_cache_impact_parameters("temperature", self.options["temperature"])