From d616898802dfe7e5dd648bcf53c6d1f86b6d3642 Mon Sep 17 00:00:00 2001
From: Bin <bin.zheng@slooong.com>
Date: 星期三, 17 十二月 2025 14:33:06 +0800
Subject: [PATCH] 图片路径测试

---
 label_studio/data_export/models.py |    2 +-
 sh/start.sh                        |    1 +
 label_studio/data_export/mixins.py |    2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/label_studio/data_export/mixins.py b/label_studio/data_export/mixins.py
index e77a23e..6406a25 100644
--- a/label_studio/data_export/mixins.py
+++ b/label_studio/data_export/mixins.py
@@ -352,7 +352,7 @@
             converter = Converter(
                 config=self.project.get_parsed_config(),
                 project_dir=None,
-                upload_dir='/data',  # 指向 /data 以匹配任务数据中的 /data/upload/ 路径
+                upload_dir=os.getenv('LS_UPLOAD_DIR', '/data'),  # 优先使用环境变量
                 download_resources=download_resources,
                 # for downloading resource we need access to the API
                 access_token=self.project.organization.created_by.auth_token.key,
diff --git a/label_studio/data_export/models.py b/label_studio/data_export/models.py
index 9dabd51..ab238df 100644
--- a/label_studio/data_export/models.py
+++ b/label_studio/data_export/models.py
@@ -159,7 +159,7 @@
         converter = Converter(
             config=project.get_parsed_config(),
             project_dir=None,
-            upload_dir='/data',  # 指向 /data 以匹配任务数据中的 /data/upload/ 路径
+            upload_dir=os.getenv('LS_UPLOAD_DIR', '/data'),  # 优先使用环境变量
             download_resources=download_resources,
             access_token=project.organization.created_by.auth_token.key,
             hostname=hostname,
diff --git a/sh/start.sh b/sh/start.sh
index 6a93fa2..efb4595 100755
--- a/sh/start.sh
+++ b/sh/start.sh
@@ -23,6 +23,7 @@
 
 export LABEL_STUDIO_BASE_DATA_DIR=${DATA_DIR}
 export TZ=Asia/Shanghai
+export LS_UPLOAD_DIR=/data
 
 # 后台启动
 nohup poetry run python label_studio/manage.py runserver 0.0.0.0:${PORT} \

--
Gitblit v1.9.3