Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

make dirs with 'exist_ok=True' (#8629)

He Wang898da23caad3
diff --git a/rag/llm/cv_model.py b/rag/llm/cv_model.py
index 8c8f239636..da7efaef18 100644
--- a/rag/llm/cv_model.py
+++ b/rag/llm/cv_model.py
@@ -240,7 +240,7 @@ class QWenCV(Base):
# stupid as hell
tmp_dir = get_project_base_directory("tmp")
if not os.path.exists(tmp_dir):
- os.mkdir(tmp_dir)
+ os.makedirs(tmp_dir, exist_ok=True)
path = os.path.join(tmp_dir, "%s.jpg" % get_uuid())
Image.open(io.BytesIO(binary)).save(path)
return [
@@ -262,7 +262,7 @@ class QWenCV(Base):
# stupid as hell
tmp_dir = get_project_base_directory("tmp")
if not os.path.exists(tmp_dir):
- os.mkdir(tmp_dir)
+ os.makedirs(tmp_dir, exist_ok=True)
path = os.path.join(tmp_dir, "%s.jpg" % get_uuid())
Image.open(io.BytesIO(binary)).save(path)