Quellcode durchsuchen

fix: 修改适配器环境变量名称,确保适配器正确激活

zhch158_admin vor 1 Woche
Ursprung
Commit
1e07675735
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 1 1
      zhch/ppstructure_v3_daemon.sh
  2. 3 3
      zhch/start_paddlex_with_adapter.py

+ 1 - 1
zhch/ppstructure_v3_daemon.sh

@@ -31,7 +31,7 @@ fi
 
 # 设置模型下载源(可选)
 export PADDLE_PDX_MODEL_SOURCE="bos"
-export PADDLEX_ENABLE_TABLE_ADAPTER="true"
+export PADDLEX_ENABLE_ADAPTER="true"
 export PYTHONWARNINGS="ignore::UserWarning"
 
 start() {

+ 3 - 3
zhch/start_paddlex_with_adapter.py

@@ -8,11 +8,11 @@ import subprocess
 
 def main():
     # 🎯 在当前进程中激活适配器
-    if os.getenv("PADDLEX_ENABLE_TABLE_ADAPTER", "").lower() in ("true", "1", "yes"):
+    if os.getenv("PADDLEX_ENABLE_ADAPTER", "").lower() in ("true", "1", "yes"):
         sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'adapters'))
         try:
-            from adapters import apply_table_recognition_adapter
-            if apply_table_recognition_adapter():
+            from adapters import apply_table_recognition_adapter, apply_enhanced_doc_preprocessor
+            if apply_table_recognition_adapter() and apply_enhanced_doc_preprocessor():
                 print("✅ Adapter activated in wrapper process")
         except Exception as e:
             print(f"⚠️  Failed to activate adapter: {e}")