Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions docs/en/notes/mm_guide/image_understanding/context_vqa.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,24 @@ The main flow includes:
```bash
mkdir run_dataflow_mm
cd run_dataflow_mm

```

### Step 2: Initialize DataFlow-MM

```bash
dataflow init

dataflowmm init
```

You will now see:

```bash
gpu_pipelines/context_vqa.py

```

### Step 3: Download Example Data

```bash
huggingface-cli download --repo-type dataset OpenDCAI/dataflow-demo-image --local-dir example_data

```

### Step 4: Configure Model and Data Paths
Expand All @@ -75,14 +71,12 @@ self.storage = FileStorage(
file_name_prefix="context_vqa",
cache_type="json",
)

```

### Step 5: One-Click Run

```bash
python gpu_pipelines/context_vqa.py

```

---
Expand All @@ -107,7 +101,6 @@ Input data is managed through `FileStorage`, supporting breakpoint resumption.
]
}
]

```

### 2. **Core Operator Logic**
Expand All @@ -125,7 +118,6 @@ self.vqa_generator.run(
input_image_key=input_image_key,
output_answer_key=output_answer_key,
)

```

#### B. **WikiQARefiner (Result Parsing)**
Expand All @@ -140,7 +132,6 @@ self.refiner.run(
input_key="vqa", # Raw text from the previous step
output_key="context_vqa" # Final structured data
)

```

### 3. **Output Data**
Expand All @@ -163,7 +154,6 @@ The final structured data includes `context` (article) and `qas` (list of questi
]
}
}

```

---
Expand Down Expand Up @@ -236,5 +226,4 @@ class ContextVQAPipeline:
if __name__ == "__main__":
pipe = ContextVQAPipeline()
pipe.forward()

```
13 changes: 1 addition & 12 deletions docs/zh/notes/mm_guide/image_understanding/context_vqa.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,24 @@ permalink: /zh/mm_guide/contextvqa_pipeline/
```bash
mkdir run_dataflow_mm
cd run_dataflow_mm

```

### 第二步:初始化 DataFlow-MM

```bash
dataflow init

dataflowmm init
```

这时你会看到:

```bash
gpu_pipelines/context_vqa.py

```

### 第三步:下载示例数据

```bash
huggingface-cli download --repo-type dataset OpenDCAI/dataflow-demo-image --local-dir example_data

```

### 第四步:配置模型与数据路径
Expand All @@ -75,14 +71,12 @@ self.storage = FileStorage(
file_name_prefix="context_vqa",
cache_type="json",
)

```

### 第五步:一键运行

```bash
python gpu_pipelines/context_vqa.py

```

---
Expand All @@ -107,7 +101,6 @@ python gpu_pipelines/context_vqa.py
]
}
]

```

### 2. **核心算子逻辑**
Expand All @@ -125,7 +118,6 @@ self.vqa_generator.run(
input_image_key=input_image_key,
output_answer_key=output_answer_key,
)

```

#### B. **WikiQARefiner(结果解析)**
Expand All @@ -140,7 +132,6 @@ self.refiner.run(
input_key="vqa", # 输入上一涉的原始文本
output_key="context_vqa" # 输出最终结构化数据
)

```

### 3. **输出数据**
Expand All @@ -163,7 +154,6 @@ self.refiner.run(
]
}
}

```

---
Expand Down Expand Up @@ -235,5 +225,4 @@ class ContextVQAPipeline:
if __name__ == "__main__":
pipe = ContextVQAPipeline()
pipe.forward()

```