11import asyncio
22
33from tqdm .asyncio import tqdm as tqdm_async
4+ import gradio as gr
45
56from graphgen .models import OpenAIModel , NetworkXStorage , TraverseStrategy , Tokenizer , JsonKVStorage
67from graphgen .templates import ANSWER_REPHRASING_PROMPT , QUESTION_GENERATION_PROMPT , MULTI_HOP_GENERATION_PROMPT
@@ -167,6 +168,7 @@ async def traverse_graph_by_edge(
167168 graph_storage : NetworkXStorage ,
168169 traverse_strategy : TraverseStrategy ,
169170 text_chunks_storage : JsonKVStorage ,
171+ progress_bar : gr .Progress = None ,
170172 max_concurrent : int = 1000
171173) -> dict :
172174 """
@@ -177,6 +179,7 @@ async def traverse_graph_by_edge(
177179 :param graph_storage
178180 :param traverse_strategy
179181 :param text_chunks_storage
182+ :param progress_bar: gradio progress bar
180183 :param max_concurrent
181184 :return: question and answer
182185 """
@@ -322,6 +325,7 @@ async def traverse_graph_atomically(
322325 graph_storage : NetworkXStorage ,
323326 traverse_strategy : TraverseStrategy ,
324327 text_chunks_storage : JsonKVStorage ,
328+ progress_bar : gr .Progress = None ,
325329 max_concurrent : int = 1000
326330) -> dict :
327331 """
@@ -332,6 +336,7 @@ async def traverse_graph_atomically(
332336 :param graph_storage
333337 :param traverse_strategy
334338 :param text_chunks_storage
339+ :param progress_bar: gradio progress bar
335340 :param max_concurrent
336341 :return: question and answer
337342 """
@@ -423,6 +428,7 @@ async def traverse_graph_for_multi_hop(
423428 graph_storage : NetworkXStorage ,
424429 traverse_strategy : TraverseStrategy ,
425430 text_chunks_storage : JsonKVStorage ,
431+ progress_bar : gr .Progress = None ,
426432 max_concurrent : int = 1000
427433) -> dict :
428434 """
@@ -433,6 +439,7 @@ async def traverse_graph_for_multi_hop(
433439 :param graph_storage
434440 :param traverse_strategy
435441 :param text_chunks_storage
442+ :param progress_bar: gradio progress bar
436443 :param max_concurrent
437444 :return: question and answer
438445 """
0 commit comments