Spaces:
Sleeping
Sleeping
Update gen_dag.py
Browse files120 unmodified lines121122123124125126127124125126127128129130129130131132133134132133134135136137138139140137138139140141142143144142143144145146147148149147148149150151152151152153154155154155156157158120 unmodified lines output_html = os.path.join(auto_path, "poster.html") graph_json_path = os.path.join(auto_path, "graph.json")
# # === 清理 markdown === 去除无意义的段落,如relative work,reference,appendix等等 # print(config) # print("🧹 Cleaning markdown before splitting...") # cleaned_md_path = clean_paper(md_path, clean_prompt, model="gemini-3-pro-preview", config=config) # === 清理 markdown === 去除无意义的段落,如relative work,reference,appendix等等 print(config) print("🧹 Cleaning markdown before splitting...") cleaned_md_path = clean_paper(md_path, clean_prompt, model="gemini-3-pro-preview", config=config)
# # === 利用gpt将论文分段 === # paths = split_paper(cleaned_md_path, section_split_prompt, model="gemini-3-pro-preview" ,config=config) # === 利用gpt将论文分段 === paths = split_paper(cleaned_md_path, section_split_prompt, model="gemini-3-pro-preview" ,config=config) # # === 利用gpt初始化dag === # dag = initialize_dag(markdown_path=cleaned_md_path,initialize_dag_prompt=initialize_dag_prompt,model="gemini-3-pro-preview", config=config) # dag_path = os.path.join(auto_path, "dag.json") # === 利用gpt初始化dag === dag = initialize_dag(markdown_path=cleaned_md_path,initialize_dag_prompt=initialize_dag_prompt,model="gemini-3-pro-preview", config=config) dag_path = os.path.join(auto_path, "dag.json")
# # === 生成visual_dag === # visual_dag_path=os.path.join(auto_path, "visual_dag.json") # extract_and_generate_visual_dag(markdown_path=cleaned_md_path,prompt_for_gpt=visual_dag_prompt,output_json_path=visual_dag_path,model="gemini-3-pro-preview", config=config) # add_resolution_to_visual_dag(auto_path, visual_dag_path) # === 生成visual_dag === visual_dag_path=os.path.join(auto_path, "visual_dag.json") extract_and_generate_visual_dag(markdown_path=cleaned_md_path,prompt_for_gpt=visual_dag_prompt,output_json_path=visual_dag_path,model="gemini-3-pro-preview", config=config) add_resolution_to_visual_dag(auto_path, visual_dag_path)
# # === 生成section_dag === # section_split_output_path=os.path.join(subdir_path, "section_split_output") # build_section_dags(folder_path=section_split_output_path,base_prompt=section_dag_generation_prompt,model="gemini-3-pro-preview", config=config) # === 生成section_dag === section_split_output_path=os.path.join(subdir_path, "section_split_output") build_section_dags(folder_path=section_split_output_path,base_prompt=section_dag_generation_prompt,model="gemini-3-pro-preview", config=config)
# # === 向dag.json添加section_dag === # section_dag_path=os.path.join(subdir_path, "section_dag") # merged_path = add_section_dag(section_dag_folder=section_dag_path,main_dag_path=dag_path,output_path=None) # === 向dag.json添加section_dag === section_dag_path=os.path.join(subdir_path, "section_dag") merged_path = add_section_dag(section_dag_folder=section_dag_path,main_dag_path=dag_path,output_path=None)
# # === 向dag.json添加visual_dag === # add_visual_dag(dag_path=dag_path,visual_dag_path=visual_dag_path) # === 向dag.json添加visual_dag === add_visual_dag(dag_path=dag_path,visual_dag_path=visual_dag_path)
# # === 完善dag中每一个结点的visual_node === # refine_visual_node(dag_path) # === 完善dag中每一个结点的visual_node === refine_visual_node(dag_path)
gen_dag.py+23-23