Bladeren bron

Merge pull request #534 from damaoooo/main

fix docker and ollama
Byaidu 10 maanden geleden
bovenliggende
commit
45181bb0a1
2 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  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"])