Skip to content

Commit c0df143

Browse files
Fix dataclass decorator issues in new VQA and MM modules
Co-authored-by: ChenZiHong-Gavin <[email protected]>
1 parent 4e8fbce commit c0df143

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

graphgen/models/generator/vqa_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from dataclasses import dataclass
22
from typing import Any
33

4-
from graphgen.bases import BaseGenerator
4+
from graphgen.bases import BaseGenerator, BaseLLMClient
55
from graphgen.templates import VQA_GENERATION_PROMPT
66
from graphgen.utils import compute_content_hash, detect_main_language, logger
77

88

99
@dataclass
1010
class VQAGenerator(BaseGenerator):
11+
llm_client: BaseLLMClient = None
12+
1113
@staticmethod
1214
def build_prompt(
1315
batch: tuple[list[tuple[str, dict]], list[tuple[Any, Any, dict]]]

graphgen/models/kg_builder/mm_kg_builder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
from collections import defaultdict
3+
from dataclasses import dataclass
34
from typing import Dict, List, Tuple
45

56
from graphgen.bases import BaseLLMClient, Chunk
@@ -15,8 +16,10 @@
1516
from .light_rag_kg_builder import LightRAGKGBuilder
1617

1718

19+
@dataclass
1820
class MMKGBuilder(LightRAGKGBuilder):
1921
llm_client: BaseLLMClient = None
22+
max_loop: int = 3
2023

2124
async def extract(
2225
self, chunk: Chunk

0 commit comments

Comments
 (0)