howard9963 commited on
Commit
b94f10f
·
verified ·
1 Parent(s): 418281f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -0
README.md CHANGED
@@ -10,5 +10,38 @@ pinned: false
10
  license: apache-2.0
11
  short_description: 測試法遵自評
12
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
10
  license: apache-2.0
11
  short_description: 測試法遵自評
12
  ---
13
+ # 法遵自評覆核系統(Hugging Face 版)
14
+
15
+ 本專案提供一個基於 **Gradio** 的 Web UI,結合 **PaddleOCR** 及 **Meta-LLaMA-3.1-8B-Instruct** 模型,用於上傳內規與自評資料並自動檢核是否符合規範。支援 PDF 文字擷取與 OCR(含繁體中文)。
16
+
17
+ ---
18
+
19
+ ## 功能特色
20
+ - 上傳多份 **單位適用內規**(支援 TXT 與 PDF,PDF 自動判斷是否需 OCR)
21
+ - 單位自評可直接輸入文字或透過附件上傳
22
+ - 上傳多份 **自評附件**
23
+ - 使用 **PaddleOCR** 支援中英文與繁體中文 OCR
24
+ - 本地推論 **Meta-LLaMA-3.1-8B-Instruct**(需先在 Hugging Face 申請存取權限)
25
+ - Debug Log 即時顯示處理流程
26
+
27
+ ---
28
+
29
+ ## 環境變數設定
30
+ | 變數名稱 | 範例值 | 說明 |
31
+ |----------|--------|------|
32
+ | `HF_TOKEN` | `hf_xxxxxxxxx` | Hugging Face Access Token(需對 LLaMA 模型有存取權限) |
33
+ | `DEVICE` | `cuda` 或 `cpu` | 推論設備(預設自動判斷) |
34
+ | `OCR_LANG` | `ch` | OCR 語言:`ch`(中英混合)、`ch_tra`(繁體)、`en`(英文) |
35
+ | `MODEL_PATH` | `/data/meta-llama/Meta-Llama-3.1-8B-Instruct` | 模型路徑(可選) |
36
+ | `CONFIG_PATH` | `/home/user/app/config/config.json` | 設定檔路徑(可選) |
37
+ | `PORT` | `7860` | Web UI 埠號(預設 Hugging Face 自動設定) |
38
+
39
+ 在 Hugging Face Spaces 可於 **Settings → Variables and secrets** 中設定以上變數。
40
+
41
+ ---
42
+
43
+ ## 安裝
44
+ ```bash
45
+ pip install -r requirements.txt
46
 
47
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference