python-gfm 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. python_gfm-0.1.1/PKG-INFO +152 -0
  2. python_gfm-0.1.1/README.md +135 -0
  3. python_gfm-0.1.1/pyproject.toml +30 -0
  4. python_gfm-0.1.1/python_gfm.egg-info/PKG-INFO +152 -0
  5. python_gfm-0.1.1/python_gfm.egg-info/SOURCES.txt +419 -0
  6. python_gfm-0.1.1/python_gfm.egg-info/entry_points.txt +3 -0
  7. python_gfm-0.1.1/python_gfm.egg-info/requires.txt +10 -0
  8. python_gfm-0.1.1/src/pygfm/__init__.py +17 -0
  9. python_gfm-0.1.1/src/pygfm/baseline_models/__init__.py +161 -0
  10. python_gfm-0.1.1/src/pygfm/baseline_models/bim_gfm/__init__.py +8 -0
  11. python_gfm-0.1.1/src/pygfm/baseline_models/bim_gfm/ablation.py +197 -0
  12. python_gfm-0.1.1/src/pygfm/baseline_models/bim_gfm/downprompt.py +105 -0
  13. python_gfm-0.1.1/src/pygfm/baseline_models/bim_gfm/preprompt.py +228 -0
  14. python_gfm-0.1.1/src/pygfm/baseline_models/bridge/__init__.py +13 -0
  15. python_gfm-0.1.1/src/pygfm/baseline_models/bridge/downprompt.py +138 -0
  16. python_gfm-0.1.1/src/pygfm/baseline_models/bridge/downprompt_graph.py +111 -0
  17. python_gfm-0.1.1/src/pygfm/baseline_models/bridge/preprompt.py +113 -0
  18. python_gfm-0.1.1/src/pygfm/baseline_models/classic_gnn/__init__.py +8 -0
  19. python_gfm-0.1.1/src/pygfm/baseline_models/classic_gnn/downprompt.py +67 -0
  20. python_gfm-0.1.1/src/pygfm/baseline_models/classic_gnn/preprompt.py +116 -0
  21. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/__init__.py +12 -0
  22. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/downprompt.py +134 -0
  23. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/downprompt_graph.py +127 -0
  24. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/__init__.py +19 -0
  25. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/build_instruct_arxiv_ds.py +159 -0
  26. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/constants.py +52 -0
  27. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/conversation.py +382 -0
  28. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/eval/run_graphgpt.py +364 -0
  29. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/eval/run_graphgpt_LP.py +322 -0
  30. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/eval/run_vicuna.py +203 -0
  31. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/GraphLlama.py +458 -0
  32. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/GraphLlama_pl.py +212 -0
  33. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/__init__.py +8 -0
  34. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/apply_delta.py +165 -0
  35. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/apply_lora.py +48 -0
  36. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/builder.py +149 -0
  37. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/compression.py +228 -0
  38. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/convert_fp16.py +26 -0
  39. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/graph_layers/__init__.py +3 -0
  40. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/graph_layers/clip_graph.py +314 -0
  41. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/graph_layers/graph_transformer.py +142 -0
  42. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/graph_layers/mpnn.py +88 -0
  43. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/graph_layers/simple_tokenizer.py +132 -0
  44. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/make_delta.py +48 -0
  45. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/model_adapter.py +551 -0
  46. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/model_registry.py +141 -0
  47. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/monkey_patch_non_inplace.py +118 -0
  48. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/model/utils.py +26 -0
  49. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/protocol/openai_api_protocol.py +172 -0
  50. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/api_provider.py +148 -0
  51. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/bard_worker.py +159 -0
  52. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/cacheflow_worker.py +346 -0
  53. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/cli.py +200 -0
  54. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/controller.py +361 -0
  55. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/controller_graph.py +298 -0
  56. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/gradio_block_arena_anony.py +506 -0
  57. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/gradio_block_arena_named.py +468 -0
  58. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/gradio_css.py +77 -0
  59. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/gradio_patch.py +168 -0
  60. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/gradio_web_server.py +714 -0
  61. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/gradio_web_server_graph.py +427 -0
  62. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/gradio_web_server_multi.py +219 -0
  63. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/huggingface_api.py +69 -0
  64. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/inference.py +314 -0
  65. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/model_worker.py +427 -0
  66. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/model_worker_graph.py +306 -0
  67. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/monitor/basic_stats.py +198 -0
  68. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/monitor/clean_battle_data.py +195 -0
  69. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/monitor/elo_analysis.py +283 -0
  70. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/monitor/hf_space_leaderboard_app.py +86 -0
  71. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/monitor/monitor.py +209 -0
  72. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/openai_api_server.py +722 -0
  73. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/register_worker.py +26 -0
  74. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/test_message.py +81 -0
  75. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve/test_throughput.py +115 -0
  76. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/train/graphchat_trainer.py +60 -0
  77. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/train/llama_flash_attn_monkey_patch.py +114 -0
  78. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/train/train_graph.py +1006 -0
  79. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/train/train_light.py +901 -0
  80. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/train/train_lora.py +157 -0
  81. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/train/train_mem.py +19 -0
  82. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/utils.py +240 -0
  83. python_gfm-0.1.1/src/pygfm/baseline_models/gcot/preprompt.py +71 -0
  84. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/__init__.py +19 -0
  85. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/build_instruct_arxiv_ds.py +159 -0
  86. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/constants.py +52 -0
  87. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/conversation.py +382 -0
  88. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/eval/run_graphgpt.py +364 -0
  89. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/eval/run_graphgpt_LP.py +322 -0
  90. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/eval/run_vicuna.py +203 -0
  91. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/GraphLlama.py +458 -0
  92. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/GraphLlama_pl.py +212 -0
  93. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/__init__.py +8 -0
  94. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/apply_delta.py +165 -0
  95. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/apply_lora.py +48 -0
  96. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/builder.py +149 -0
  97. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/compression.py +228 -0
  98. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/convert_fp16.py +26 -0
  99. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/graph_layers/__init__.py +3 -0
  100. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/graph_layers/clip_graph.py +314 -0
  101. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/graph_layers/graph_transformer.py +142 -0
  102. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/graph_layers/mpnn.py +88 -0
  103. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/graph_layers/simple_tokenizer.py +132 -0
  104. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/make_delta.py +48 -0
  105. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/model_adapter.py +551 -0
  106. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/model_registry.py +141 -0
  107. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/monkey_patch_non_inplace.py +118 -0
  108. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/model/utils.py +26 -0
  109. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/protocol/openai_api_protocol.py +172 -0
  110. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/__init__.py +0 -0
  111. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/api_provider.py +148 -0
  112. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/bard_worker.py +159 -0
  113. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/cacheflow_worker.py +346 -0
  114. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/cli.py +200 -0
  115. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/controller.py +361 -0
  116. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/controller_graph.py +298 -0
  117. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/gradio_block_arena_anony.py +506 -0
  118. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/gradio_block_arena_named.py +468 -0
  119. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/gradio_css.py +77 -0
  120. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/gradio_patch.py +168 -0
  121. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/gradio_web_server.py +714 -0
  122. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/gradio_web_server_graph.py +427 -0
  123. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/gradio_web_server_multi.py +219 -0
  124. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/huggingface_api.py +69 -0
  125. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/inference.py +314 -0
  126. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/model_worker.py +427 -0
  127. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/model_worker_graph.py +306 -0
  128. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/monitor/basic_stats.py +198 -0
  129. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/monitor/clean_battle_data.py +195 -0
  130. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/monitor/elo_analysis.py +283 -0
  131. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/monitor/hf_space_leaderboard_app.py +86 -0
  132. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/monitor/monitor.py +209 -0
  133. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/openai_api_server.py +722 -0
  134. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/register_worker.py +26 -0
  135. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/test_message.py +81 -0
  136. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/serve/test_throughput.py +115 -0
  137. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/train/graphchat_trainer.py +60 -0
  138. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/train/llama_flash_attn_monkey_patch.py +114 -0
  139. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/train/train_graph.py +1006 -0
  140. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/train/train_light.py +901 -0
  141. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/train/train_lora.py +157 -0
  142. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/train/train_mem.py +19 -0
  143. python_gfm-0.1.1/src/pygfm/baseline_models/graphgpt/utils.py +240 -0
  144. python_gfm-0.1.1/src/pygfm/baseline_models/graphkeeper/__init__.py +14 -0
  145. python_gfm-0.1.1/src/pygfm/baseline_models/graphkeeper/downprompt.py +103 -0
  146. python_gfm-0.1.1/src/pygfm/baseline_models/graphkeeper/downprompt_graph.py +114 -0
  147. python_gfm-0.1.1/src/pygfm/baseline_models/graphkeeper/preprompt.py +153 -0
  148. python_gfm-0.1.1/src/pygfm/baseline_models/graphmore/__init__.py +13 -0
  149. python_gfm-0.1.1/src/pygfm/baseline_models/graphmore/downprompt.py +277 -0
  150. python_gfm-0.1.1/src/pygfm/baseline_models/graphmore/downprompt_graph.py +141 -0
  151. python_gfm-0.1.1/src/pygfm/baseline_models/graphmore/preprompt.py +537 -0
  152. python_gfm-0.1.1/src/pygfm/baseline_models/graphprompt/__init__.py +10 -0
  153. python_gfm-0.1.1/src/pygfm/baseline_models/graphprompt/downprompt.py +66 -0
  154. python_gfm-0.1.1/src/pygfm/baseline_models/graphprompt/downprompt_graph.py +74 -0
  155. python_gfm-0.1.1/src/pygfm/baseline_models/graphprompt/preprompt.py +73 -0
  156. python_gfm-0.1.1/src/pygfm/baseline_models/graphprompt/prompt_layers.py +39 -0
  157. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/__init__.py +9 -0
  158. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/eval/__init__.py +2 -0
  159. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/eval/run_icl.py +72 -0
  160. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/__init__.py +0 -0
  161. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/agent.py +251 -0
  162. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/conversation.py +157 -0
  163. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/graph_instruction_dataset.py +153 -0
  164. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/icl.py +75 -0
  165. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/llama_flash_attn_monkey_patch.py +121 -0
  166. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/model.py +608 -0
  167. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/prompts.py +67 -0
  168. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/graph_text/samplers.py +165 -0
  169. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/llm/__init__.py +1 -0
  170. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/llm/deepseek.py +84 -0
  171. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/llm/fake_llm.py +16 -0
  172. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/llm/gpt.py +43 -0
  173. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/llm/llama_icl.py +51 -0
  174. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/llm/llm.py +28 -0
  175. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/llm/smoke_llm.py +249 -0
  176. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/train/__init__.py +2 -0
  177. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/train/run_sft.py +170 -0
  178. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/__init__.py +1 -0
  179. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/basics/__init__.py +7 -0
  180. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/basics/cfg_utils.py +164 -0
  181. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/basics/iterables.py +10 -0
  182. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/basics/logging.py +53 -0
  183. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/basics/np_utils.py +40 -0
  184. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/basics/os_utils.py +455 -0
  185. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/data/__init__.py +0 -0
  186. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/data/graph_tree.py +119 -0
  187. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/data/ppr.py +2 -0
  188. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/data/preprocess.py +78 -0
  189. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/data/pyg_graph.py +2 -0
  190. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/data/textual_graph.py +839 -0
  191. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/pkg/__init__.py +0 -0
  192. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/pkg/dict2xml.py +2 -0
  193. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/pkg/distributed.py +342 -0
  194. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/pkg/graph_utils.py +2 -0
  195. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/pkg/hf_utils.py +32 -0
  196. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/project/__init__.py +1 -0
  197. python_gfm-0.1.1/src/pygfm/baseline_models/graphtext/utils/project/exp.py +74 -0
  198. python_gfm-0.1.1/src/pygfm/baseline_models/graver/__init__.py +13 -0
  199. python_gfm-0.1.1/src/pygfm/baseline_models/graver/downprompt.py +317 -0
  200. python_gfm-0.1.1/src/pygfm/baseline_models/graver/downprompt_graph.py +102 -0
  201. python_gfm-0.1.1/src/pygfm/baseline_models/graver/preprompt.py +207 -0
  202. python_gfm-0.1.1/src/pygfm/baseline_models/hgprompt/__init__.py +8 -0
  203. python_gfm-0.1.1/src/pygfm/baseline_models/hgprompt/downprompt.py +60 -0
  204. python_gfm-0.1.1/src/pygfm/baseline_models/hgprompt/preprompt.py +66 -0
  205. python_gfm-0.1.1/src/pygfm/baseline_models/hgprompt/prompt_layers.py +33 -0
  206. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/__init__.py +10 -0
  207. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/eval/__init__.py +1 -0
  208. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/eval/eval_pretrain.py +324 -0
  209. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/eval/eval_pretrain_logit.py +292 -0
  210. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/eval/eval_res.py +403 -0
  211. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/fixtures/__init__.py +1 -0
  212. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/fixtures/smoke_bundle.py +76 -0
  213. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/io_utils.py +15 -0
  214. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/__init__.py +3 -0
  215. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/apply_delta.py +48 -0
  216. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/builder.py +160 -0
  217. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/consolidate.py +29 -0
  218. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/llaga_llama.py +144 -0
  219. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/llaga_mpt.py +132 -0
  220. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/llaga_opt.py +146 -0
  221. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/adapt_tokenizer.py +41 -0
  222. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/attention.py +300 -0
  223. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/blocks.py +41 -0
  224. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/configuration_mpt.py +118 -0
  225. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/custom_embedding.py +11 -0
  226. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/flash_attn_triton.py +484 -0
  227. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/hf_prefixlm_converter.py +456 -0
  228. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/meta_init_context.py +94 -0
  229. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/modeling_mpt.py +332 -0
  230. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/norm.py +56 -0
  231. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/language_model/mpt/param_init_fns.py +181 -0
  232. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/llaga_arch.py +398 -0
  233. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/make_delta.py +52 -0
  234. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/model/utils.py +20 -0
  235. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/paths.py +90 -0
  236. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/pyg_dataset.py +172 -0
  237. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/train/__init__.py +1 -0
  238. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/train/llaga_trainer.py +189 -0
  239. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/train/llama_flash_attn_monkey_patch.py +115 -0
  240. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/train/train.py +1256 -0
  241. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/train/train_mem.py +16 -0
  242. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/utils/__init__.py +0 -0
  243. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/utils/constants.py +12 -0
  244. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/utils/conversation.py +405 -0
  245. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/utils/data_process.py +222 -0
  246. python_gfm-0.1.1/src/pygfm/baseline_models/llaga/utils/utils.py +41 -0
  247. python_gfm-0.1.1/src/pygfm/baseline_models/mdgfm/__init__.py +14 -0
  248. python_gfm-0.1.1/src/pygfm/baseline_models/mdgfm/downprompt.py +89 -0
  249. python_gfm-0.1.1/src/pygfm/baseline_models/mdgfm/downprompt_graph.py +108 -0
  250. python_gfm-0.1.1/src/pygfm/baseline_models/mdgfm/preprompt.py +99 -0
  251. python_gfm-0.1.1/src/pygfm/baseline_models/mdgpt/__init__.py +14 -0
  252. python_gfm-0.1.1/src/pygfm/baseline_models/mdgpt/downprompt.py +85 -0
  253. python_gfm-0.1.1/src/pygfm/baseline_models/mdgpt/downprompt_graph.py +131 -0
  254. python_gfm-0.1.1/src/pygfm/baseline_models/mdgpt/multidomain_gfm.py +68 -0
  255. python_gfm-0.1.1/src/pygfm/baseline_models/mdgpt/preprompt.py +102 -0
  256. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/__init__.py +10 -0
  257. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/aug.py +159 -0
  258. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/downprompt.py +287 -0
  259. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/layers/__init__.py +4 -0
  260. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/layers/discriminator.py +33 -0
  261. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/layers/discriminator2.py +33 -0
  262. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/layers/gcn.py +48 -0
  263. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/layers/readout.py +16 -0
  264. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/models/LP.py +59 -0
  265. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/models/__init__.py +11 -0
  266. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/models/dgi.py +86 -0
  267. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/models/gcnlayers.py +89 -0
  268. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/models/graphcl.py +125 -0
  269. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/models/logreg.py +22 -0
  270. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/paths.py +81 -0
  271. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/preprompt.py +178 -0
  272. python_gfm-0.1.1/src/pygfm/baseline_models/multigprompt/utils/process.py +378 -0
  273. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/__init__.py +9 -0
  274. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/KG/__init__.py +1 -0
  275. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/KG/gen_data.py +145 -0
  276. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/__init__.py +1 -0
  277. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/chemmol/__init__.py +1 -0
  278. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/chemmol/gen_data.py +161 -0
  279. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/chemmol/gen_raw_graph.py +221 -0
  280. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/ofa_data.py +254 -0
  281. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/Cora/__init__.py +0 -0
  282. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/Cora/gen_data.py +212 -0
  283. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/Pubmed/__init__.py +0 -0
  284. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/Pubmed/gen_data.py +63 -0
  285. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/__init__.py +1 -0
  286. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/arxiv/__init__.py +0 -0
  287. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/arxiv/gen_data.py +116 -0
  288. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/gen_data.py +50 -0
  289. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/wikics/__init__.py +0 -0
  290. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/single_graph/wikics/gen_data.py +53 -0
  291. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/data/torch_io.py +15 -0
  292. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/fs_datamanager.py +46 -0
  293. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/__init__.py +5 -0
  294. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/lightning/data_template.py +165 -0
  295. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/lightning/metric.py +295 -0
  296. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/lightning/module_template.py +174 -0
  297. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/lightning/training.py +165 -0
  298. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/__init__.py +0 -0
  299. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/layer/pyg.py +159 -0
  300. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/loss.py +19 -0
  301. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/models/GNN.py +196 -0
  302. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/models/__init__.py +5 -0
  303. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/models/dgl.py +93 -0
  304. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/models/pyg.py +132 -0
  305. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/models/task_predictor.py +142 -0
  306. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/models/util_model.py +122 -0
  307. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/pooling.py +192 -0
  308. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/nn/resolver.py +78 -0
  309. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/utils/__init__.py +0 -0
  310. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/utils/datasets.py +42 -0
  311. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/utils/graph.py +107 -0
  312. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/utils/io.py +193 -0
  313. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/gp/utils/utils.py +360 -0
  314. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/lightning_model.py +6 -0
  315. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/models/__init__.py +1 -0
  316. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/models/model.py +442 -0
  317. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/ofa_datasets.py +712 -0
  318. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/paths.py +73 -0
  319. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/run_cdm.py +303 -0
  320. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/task_constructor.py +555 -0
  321. python_gfm-0.1.1/src/pygfm/baseline_models/oneforall/utils.py +225 -0
  322. python_gfm-0.1.1/src/pygfm/baseline_models/rag_gfm/__init__.py +6 -0
  323. python_gfm-0.1.1/src/pygfm/baseline_models/rag_gfm/preprompt.py +87 -0
  324. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/__init__.py +11 -0
  325. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/__init__.py +1 -0
  326. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/lib/__init__.py +1 -0
  327. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/lib/data_utils.py +20 -0
  328. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/lib/gcn_surrogate.py +24 -0
  329. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/lib/paths.py +5 -0
  330. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/pipeline/01_train_gcn_surrogate.py +101 -0
  331. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/pipeline/02_nettack_reports.py +221 -0
  332. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/pipeline/03_assemble_final.py +87 -0
  333. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/pipeline/04_random_perturb.py +98 -0
  334. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/pipeline/05_metattack_surrogate.py +80 -0
  335. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/attack_data_gen/pipeline/06_metattack_batch.py +160 -0
  336. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/community_detection/__init__.py +1 -0
  337. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/community_detection/pipeline/01_detect_communities.py +114 -0
  338. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/community_detection/pipeline/02_analyze_communities.py +71 -0
  339. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/downstream/__init__.py +1 -0
  340. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/downstream/lib/__init__.py +1 -0
  341. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/downstream/lib/config.py +296 -0
  342. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/downstream/models/__init__.py +1 -0
  343. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/downstream/models/down_model.py +246 -0
  344. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/downstream/models/moe.py +55 -0
  345. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/downstream/pipeline/__init__.py +1 -0
  346. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/downstream/pipeline/train_downstream.py +463 -0
  347. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/few_shot_gen/__init__.py +1 -0
  348. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/few_shot_gen/pipeline/01_generate_splits.py +128 -0
  349. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/node_feature_enhance/__init__.py +1 -0
  350. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/node_feature_enhance/pipeline/01_build_enhanced_x.py +208 -0
  351. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/paths.py +136 -0
  352. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/pretrain/__init__.py +1 -0
  353. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/pretrain/pipeline/__init__.py +1 -0
  354. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/pretrain/pipeline/data_utils.py +85 -0
  355. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/pretrain/pipeline/model.py +110 -0
  356. python_gfm-0.1.1/src/pygfm/baseline_models/sa2gfm/pretrain/pipeline/train_single.py +151 -0
  357. python_gfm-0.1.1/src/pygfm/baseline_models/samgpt/__init__.py +14 -0
  358. python_gfm-0.1.1/src/pygfm/baseline_models/samgpt/downprompt.py +137 -0
  359. python_gfm-0.1.1/src/pygfm/baseline_models/samgpt/downprompt_graph.py +142 -0
  360. python_gfm-0.1.1/src/pygfm/baseline_models/samgpt/preprompt.py +127 -0
  361. python_gfm-0.1.1/src/pygfm/cli/__init__.py +1 -0
  362. python_gfm-0.1.1/src/pygfm/cli/sa2gfm.py +15 -0
  363. python_gfm-0.1.1/src/pygfm/private/__init__.py +1 -0
  364. python_gfm-0.1.1/src/pygfm/private/core/__init__.py +31 -0
  365. python_gfm-0.1.1/src/pygfm/private/core/gnn_encoder.py +383 -0
  366. python_gfm-0.1.1/src/pygfm/private/utlis/__init__.py +86 -0
  367. python_gfm-0.1.1/src/pygfm/private/utlis/domain_alignment.py +194 -0
  368. python_gfm-0.1.1/src/pygfm/private/utlis/downstream_data_gen/__init__.py +20 -0
  369. python_gfm-0.1.1/src/pygfm/private/utlis/downstream_data_gen/generator.py +420 -0
  370. python_gfm-0.1.1/src/pygfm/private/utlis/feature_handling.py +361 -0
  371. python_gfm-0.1.1/src/pygfm/private/utlis/graph_construction.py +27 -0
  372. python_gfm-0.1.1/src/pygfm/private/utlis/graph_type_variants.py +219 -0
  373. python_gfm-0.1.1/src/pygfm/private/utlis/loss_calculation.py +22 -0
  374. python_gfm-0.1.1/src/pygfm/private/utlis/rag_gfm/__init__.py +22 -0
  375. python_gfm-0.1.1/src/pygfm/private/utlis/rag_gfm/corpus_builder.py +229 -0
  376. python_gfm-0.1.1/src/pygfm/private/utlis/rag_gfm/motif_builder.py +455 -0
  377. python_gfm-0.1.1/src/pygfm/public/__init__.py +1 -0
  378. python_gfm-0.1.1/src/pygfm/public/backbone_models/__init__.py +31 -0
  379. python_gfm-0.1.1/src/pygfm/public/backbone_models/gnn_encoder.py +383 -0
  380. python_gfm-0.1.1/src/pygfm/public/cli/__init__.py +1 -0
  381. python_gfm-0.1.1/src/pygfm/public/cli/default_ckpt.py +44 -0
  382. python_gfm-0.1.1/src/pygfm/public/cli/export_yaml.py +177 -0
  383. python_gfm-0.1.1/src/pygfm/public/cli/multigprompt_config.py +174 -0
  384. python_gfm-0.1.1/src/pygfm/public/cli/yaml_config.py +160 -0
  385. python_gfm-0.1.1/src/pygfm/public/cli/yaml_flat_to_argv.py +32 -0
  386. python_gfm-0.1.1/src/pygfm/public/model_bases.py +72 -0
  387. python_gfm-0.1.1/src/pygfm/public/utils/__init__.py +20 -0
  388. python_gfm-0.1.1/src/pygfm/public/utils/data_process/__init__.py +20 -0
  389. python_gfm-0.1.1/src/pygfm/public/utils/data_process/ogb_preprocess.py +43 -0
  390. python_gfm-0.1.1/src/pygfm/public/utils/data_process/pyg_graph.py +105 -0
  391. python_gfm-0.1.1/src/pygfm/public/utils/data_process/text_embed.py +100 -0
  392. python_gfm-0.1.1/src/pygfm/public/utils/llm/__init__.py +27 -0
  393. python_gfm-0.1.1/src/pygfm/public/utils/llm/dev_llm_stub.py +74 -0
  394. python_gfm-0.1.1/src/pygfm/public/utils/llm/hf_hub.py +56 -0
  395. python_gfm-0.1.1/src/pygfm/public/utils/llm/openai_api.py +5 -0
  396. python_gfm-0.1.1/src/pygfm/public/utils/llm/openai_client.py +267 -0
  397. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/__init__.py +43 -0
  398. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/cca_loss.py +92 -0
  399. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/domain_contrastive.py +67 -0
  400. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/domain_regularizer.py +94 -0
  401. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/gradient_reversal.py +18 -0
  402. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/info_nce_mi_matrix.py +36 -0
  403. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/loss_support.py +56 -0
  404. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/motif_contrastive_loss.py +26 -0
  405. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/negative_sampling.py +60 -0
  406. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/node_node_contrastive.py +39 -0
  407. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/pairwise_ranking.py +74 -0
  408. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/spectral_loss.py +53 -0
  409. python_gfm-0.1.1/src/pygfm/public/utils/loss_func/task_head.py +51 -0
  410. python_gfm-0.1.1/src/pygfm/public/utils/others/__init__.py +80 -0
  411. python_gfm-0.1.1/src/pygfm/public/utils/others/core.py +79 -0
  412. python_gfm-0.1.1/src/pygfm/public/utils/others/dict2xml.py +276 -0
  413. python_gfm-0.1.1/src/pygfm/public/utils/others/distributed_compat.py +68 -0
  414. python_gfm-0.1.1/src/pygfm/public/utils/others/graph_utils.py +243 -0
  415. python_gfm-0.1.1/src/pygfm/public/utils/others/ppr.py +357 -0
  416. python_gfm-0.1.1/src/pygfm/public/utils/others/runtime.py +75 -0
  417. python_gfm-0.1.1/src/pygfm/public/utils/runtime.py +607 -0
  418. python_gfm-0.1.0/PKG-INFO +0 -23
  419. python_gfm-0.1.0/README.md +0 -15
  420. python_gfm-0.1.0/pyproject.toml +0 -13
  421. python_gfm-0.1.0/src/python_gfm.egg-info/PKG-INFO +0 -23
  422. python_gfm-0.1.0/src/python_gfm.egg-info/SOURCES.txt +0 -7
  423. {python_gfm-0.1.0/src → python_gfm-0.1.1}/python_gfm.egg-info/dependency_links.txt +0 -0
  424. {python_gfm-0.1.0/src → python_gfm-0.1.1}/python_gfm.egg-info/top_level.txt +0 -0
  425. {python_gfm-0.1.0 → python_gfm-0.1.1}/setup.cfg +0 -0
  426. {python_gfm-0.1.0/src/pygfm → python_gfm-0.1.1/src/pygfm/baseline_models/gcot/graphgpt/serve}/__init__.py +0 -0
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-gfm
3
+ Version: 0.1.1
4
+ Summary: An AI copilot for graph data and models (Under active development).
5
+ Author-email: BUAA SKLCCSE <your.email@example.com>
6
+ License: Apache-2.0
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: numpy>=1.20
10
+ Requires-Dist: pyyaml>=6
11
+ Provides-Extra: torch
12
+ Requires-Dist: torch>=2.0; extra == "torch"
13
+ Requires-Dist: torch-geometric>=2.3; extra == "torch"
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest; extra == "dev"
16
+ Requires-Dist: ruff; extra == "dev"
17
+
18
+ # pygfm
19
+
20
+ [PyPI version](https://pypi.org/project/pygfm/)
21
+ [Python](https://pypi.org/project/pygfm/)
22
+ [License](LICENSE)
23
+
24
+ A unified Python toolkit for **Graph Foundation Models (GFM)** research, integrating 19 baseline methods under a single package with shared utilities, standardized interfaces, and reproducible experiment pipelines.
25
+
26
+ Developed by **Beihang University, School of Computer Science and Engineering, ACT Lab, MAGIC GROUP**.
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ pip install python-gfm
32
+ ```
33
+
34
+ Install with optional dependencies:
35
+
36
+ ```bash
37
+ pip install python-gfm[torch] # PyTorch + PyG
38
+ pip install python-gfm[dev] # pytest + ruff
39
+ ```
40
+
41
+ For development (full checkout with experiment scripts):
42
+
43
+ ```bash
44
+ git clone <repo-url> && cd pythongfm
45
+ pip install -e ".[torch,dev]"
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ ```python
51
+ import pygfm
52
+
53
+ print(pygfm.__version__)
54
+ ```
55
+
56
+ ## Package Structure
57
+
58
+ ```
59
+ pygfm/
60
+ ├── baseline_models/ # 19 GFM baseline implementations
61
+ ├── public/ # Shared utilities, losses, backbone encoders
62
+ │ ├── backbone_models/
63
+ │ ├── utils/
64
+ │ ├── cli/
65
+ │ └── model_bases.py
66
+ ├── private/ # Internal modules (core encoders, data generation)
67
+ └── cli/ # Console entrypoints
68
+ ```
69
+
70
+ ## Supported Baselines
71
+
72
+
73
+ | Category | Baselines |
74
+ | ------------------- | --------------------------------------------------------------- |
75
+ | Prompt-based GFM | MDGPT, SAMGPT, MDGFM, GraphPrompt, HGPrompt, MultiGPrompt, GCoT |
76
+ | Structure-aware | SA2GFM, Bridge, GraphKeeper, GraphMore, Graver, BIM-GFM |
77
+ | LLM-integrated | GraphGPT, GraphText, LLaGA, OneForAll |
78
+ | Retrieval-augmented | RAG-GFM |
79
+ | Classic | Classic GNN |
80
+
81
+
82
+ ## Running Experiments
83
+
84
+ Each baseline has its own experiment scripts under `scripts/<baseline>/`. Run from the repository root:
85
+
86
+ ```bash
87
+ # Pre-training
88
+ python scripts/mdgpt/pretrain.py
89
+
90
+ # Downstream fine-tuning
91
+ python scripts/sa2gfm/downstream.py
92
+
93
+ # Full pipeline with config
94
+ python scripts/gcot/pretrain.py
95
+ python scripts/gcot/finetune.py
96
+ python scripts/gcot/finetune_graph.py
97
+ ```
98
+
99
+ ## Console Commands
100
+
101
+ After installation, the following CLI commands are available:
102
+
103
+
104
+ | Command | Description |
105
+ | ----------------------- | ------------------------------------------- |
106
+ | `gfm-sa2gfm-pretrain` | SA2GFM contrastive pre-training (`-c` YAML) |
107
+ | `gfm-sa2gfm-downstream` | SA2GFM MoE downstream fine-tuning |
108
+
109
+
110
+ ## Baseline Documentation
111
+
112
+ Detailed instructions for each baseline:
113
+
114
+
115
+ | Baseline | Docs |
116
+ | ------------ | ------------------------------------------------------------------ |
117
+ | MDGPT | `[scripts/mdgpt/README.md](scripts/mdgpt/README.md)` |
118
+ | SA2GFM | `[scripts/sa2gfm/README.md](scripts/sa2gfm/README.md)` |
119
+ | MultiGPrompt | `[scripts/multigprompt/README.md](scripts/multigprompt/README.md)` |
120
+ | LLaGA | `[scripts/llaga/README.md](scripts/llaga/README.md)` |
121
+ | GraphText | `[scripts/graphtext/README.md](scripts/graphtext/README.md)` |
122
+ | GraphGPT | `[scripts/graphgpt/README.md](scripts/graphgpt/README.md)` |
123
+ | OneForAll | `[scripts/oneforall/README.md](scripts/oneforall/README.md)` |
124
+ | MDGFM | `[scripts/mdgfm/README.md](scripts/mdgfm/README.md)` |
125
+ | SAMGPT | `[scripts/samgpt/README.md](scripts/samgpt/README.md)` |
126
+ | GCoT | `[scripts/gcot/README.md](scripts/gcot/README.md)` |
127
+ | HGPrompt | `[scripts/hgprompt/README.md](scripts/hgprompt/README.md)` |
128
+ | GraphPrompt | `[scripts/graphprompt/README.md](scripts/graphprompt/README.md)` |
129
+ | Graver | `[scripts/graver/README.md](scripts/graver/README.md)` |
130
+ | GraphMore | `[scripts/graphmore/README.md](scripts/graphmore/README.md)` |
131
+ | Bridge | `[scripts/bridge/README.md](scripts/bridge/README.md)` |
132
+ | GraphKeeper | `[scripts/graphkeeper/README.md](scripts/graphkeeper/README.md)` |
133
+ | RAG-GFM | `[scripts/rag_gfm/README.md](scripts/rag_gfm/README.md)` |
134
+
135
+
136
+ ## Configuration
137
+
138
+ Experiment configs are YAML files located at `scripts/<baseline>/configs/`. Pass them via `-c` flag or as positional arguments depending on the baseline.
139
+
140
+ **Important:** Do **not** commit API keys. For baselines that require LLM API access (e.g., GraphText), copy the example config and fill in your keys locally:
141
+
142
+ ```bash
143
+ cp scripts/graphtext/config/user/env.yaml.example scripts/graphtext/config/user/env.yaml
144
+ ```
145
+
146
+ ## License
147
+
148
+ This project is licensed under the [Apache License 2.0](LICENSE).
149
+
150
+ ## Team
151
+
152
+ **MAGIC GROUP** -- Beihang University, School of Computer Science and Engineering, ACT Lab.
@@ -0,0 +1,135 @@
1
+ # pygfm
2
+
3
+ [PyPI version](https://pypi.org/project/pygfm/)
4
+ [Python](https://pypi.org/project/pygfm/)
5
+ [License](LICENSE)
6
+
7
+ A unified Python toolkit for **Graph Foundation Models (GFM)** research, integrating 19 baseline methods under a single package with shared utilities, standardized interfaces, and reproducible experiment pipelines.
8
+
9
+ Developed by **Beihang University, School of Computer Science and Engineering, ACT Lab, MAGIC GROUP**.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install python-gfm
15
+ ```
16
+
17
+ Install with optional dependencies:
18
+
19
+ ```bash
20
+ pip install python-gfm[torch] # PyTorch + PyG
21
+ pip install python-gfm[dev] # pytest + ruff
22
+ ```
23
+
24
+ For development (full checkout with experiment scripts):
25
+
26
+ ```bash
27
+ git clone <repo-url> && cd pythongfm
28
+ pip install -e ".[torch,dev]"
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```python
34
+ import pygfm
35
+
36
+ print(pygfm.__version__)
37
+ ```
38
+
39
+ ## Package Structure
40
+
41
+ ```
42
+ pygfm/
43
+ ├── baseline_models/ # 19 GFM baseline implementations
44
+ ├── public/ # Shared utilities, losses, backbone encoders
45
+ │ ├── backbone_models/
46
+ │ ├── utils/
47
+ │ ├── cli/
48
+ │ └── model_bases.py
49
+ ├── private/ # Internal modules (core encoders, data generation)
50
+ └── cli/ # Console entrypoints
51
+ ```
52
+
53
+ ## Supported Baselines
54
+
55
+
56
+ | Category | Baselines |
57
+ | ------------------- | --------------------------------------------------------------- |
58
+ | Prompt-based GFM | MDGPT, SAMGPT, MDGFM, GraphPrompt, HGPrompt, MultiGPrompt, GCoT |
59
+ | Structure-aware | SA2GFM, Bridge, GraphKeeper, GraphMore, Graver, BIM-GFM |
60
+ | LLM-integrated | GraphGPT, GraphText, LLaGA, OneForAll |
61
+ | Retrieval-augmented | RAG-GFM |
62
+ | Classic | Classic GNN |
63
+
64
+
65
+ ## Running Experiments
66
+
67
+ Each baseline has its own experiment scripts under `scripts/<baseline>/`. Run from the repository root:
68
+
69
+ ```bash
70
+ # Pre-training
71
+ python scripts/mdgpt/pretrain.py
72
+
73
+ # Downstream fine-tuning
74
+ python scripts/sa2gfm/downstream.py
75
+
76
+ # Full pipeline with config
77
+ python scripts/gcot/pretrain.py
78
+ python scripts/gcot/finetune.py
79
+ python scripts/gcot/finetune_graph.py
80
+ ```
81
+
82
+ ## Console Commands
83
+
84
+ After installation, the following CLI commands are available:
85
+
86
+
87
+ | Command | Description |
88
+ | ----------------------- | ------------------------------------------- |
89
+ | `gfm-sa2gfm-pretrain` | SA2GFM contrastive pre-training (`-c` YAML) |
90
+ | `gfm-sa2gfm-downstream` | SA2GFM MoE downstream fine-tuning |
91
+
92
+
93
+ ## Baseline Documentation
94
+
95
+ Detailed instructions for each baseline:
96
+
97
+
98
+ | Baseline | Docs |
99
+ | ------------ | ------------------------------------------------------------------ |
100
+ | MDGPT | `[scripts/mdgpt/README.md](scripts/mdgpt/README.md)` |
101
+ | SA2GFM | `[scripts/sa2gfm/README.md](scripts/sa2gfm/README.md)` |
102
+ | MultiGPrompt | `[scripts/multigprompt/README.md](scripts/multigprompt/README.md)` |
103
+ | LLaGA | `[scripts/llaga/README.md](scripts/llaga/README.md)` |
104
+ | GraphText | `[scripts/graphtext/README.md](scripts/graphtext/README.md)` |
105
+ | GraphGPT | `[scripts/graphgpt/README.md](scripts/graphgpt/README.md)` |
106
+ | OneForAll | `[scripts/oneforall/README.md](scripts/oneforall/README.md)` |
107
+ | MDGFM | `[scripts/mdgfm/README.md](scripts/mdgfm/README.md)` |
108
+ | SAMGPT | `[scripts/samgpt/README.md](scripts/samgpt/README.md)` |
109
+ | GCoT | `[scripts/gcot/README.md](scripts/gcot/README.md)` |
110
+ | HGPrompt | `[scripts/hgprompt/README.md](scripts/hgprompt/README.md)` |
111
+ | GraphPrompt | `[scripts/graphprompt/README.md](scripts/graphprompt/README.md)` |
112
+ | Graver | `[scripts/graver/README.md](scripts/graver/README.md)` |
113
+ | GraphMore | `[scripts/graphmore/README.md](scripts/graphmore/README.md)` |
114
+ | Bridge | `[scripts/bridge/README.md](scripts/bridge/README.md)` |
115
+ | GraphKeeper | `[scripts/graphkeeper/README.md](scripts/graphkeeper/README.md)` |
116
+ | RAG-GFM | `[scripts/rag_gfm/README.md](scripts/rag_gfm/README.md)` |
117
+
118
+
119
+ ## Configuration
120
+
121
+ Experiment configs are YAML files located at `scripts/<baseline>/configs/`. Pass them via `-c` flag or as positional arguments depending on the baseline.
122
+
123
+ **Important:** Do **not** commit API keys. For baselines that require LLM API access (e.g., GraphText), copy the example config and fill in your keys locally:
124
+
125
+ ```bash
126
+ cp scripts/graphtext/config/user/env.yaml.example scripts/graphtext/config/user/env.yaml
127
+ ```
128
+
129
+ ## License
130
+
131
+ This project is licensed under the [Apache License 2.0](LICENSE).
132
+
133
+ ## Team
134
+
135
+ **MAGIC GROUP** -- Beihang University, School of Computer Science and Engineering, ACT Lab.
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "python-gfm"
7
+ version = "0.1.1"
8
+ authors = [
9
+ { name = "BUAA SKLCCSE", email = "your.email@example.com" },
10
+ ]
11
+ description = "An AI copilot for graph data and models (Under active development)."
12
+ readme = "README.md"
13
+ requires-python = ">=3.10"
14
+ license = { text = "Apache-2.0" }
15
+ dependencies = [
16
+ "numpy>=1.20",
17
+ "pyyaml>=6",
18
+ ]
19
+
20
+ [project.optional-dependencies]
21
+ torch = ["torch>=2.0", "torch-geometric>=2.3"]
22
+ dev = ["pytest", "ruff"]
23
+
24
+ [project.scripts]
25
+ gfm-sa2gfm-pretrain = "pygfm.cli.sa2gfm:pretrain_main"
26
+ gfm-sa2gfm-downstream = "pygfm.cli.sa2gfm:downstream_main"
27
+
28
+ [tool.setuptools.packages.find]
29
+ where = ["src", "scripts", "ckpts"]
30
+ include = ["pygfm*"]
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-gfm
3
+ Version: 0.1.1
4
+ Summary: An AI copilot for graph data and models (Under active development).
5
+ Author-email: BUAA SKLCCSE <your.email@example.com>
6
+ License: Apache-2.0
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: numpy>=1.20
10
+ Requires-Dist: pyyaml>=6
11
+ Provides-Extra: torch
12
+ Requires-Dist: torch>=2.0; extra == "torch"
13
+ Requires-Dist: torch-geometric>=2.3; extra == "torch"
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest; extra == "dev"
16
+ Requires-Dist: ruff; extra == "dev"
17
+
18
+ # pygfm
19
+
20
+ [PyPI version](https://pypi.org/project/pygfm/)
21
+ [Python](https://pypi.org/project/pygfm/)
22
+ [License](LICENSE)
23
+
24
+ A unified Python toolkit for **Graph Foundation Models (GFM)** research, integrating 19 baseline methods under a single package with shared utilities, standardized interfaces, and reproducible experiment pipelines.
25
+
26
+ Developed by **Beihang University, School of Computer Science and Engineering, ACT Lab, MAGIC GROUP**.
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ pip install python-gfm
32
+ ```
33
+
34
+ Install with optional dependencies:
35
+
36
+ ```bash
37
+ pip install python-gfm[torch] # PyTorch + PyG
38
+ pip install python-gfm[dev] # pytest + ruff
39
+ ```
40
+
41
+ For development (full checkout with experiment scripts):
42
+
43
+ ```bash
44
+ git clone <repo-url> && cd pythongfm
45
+ pip install -e ".[torch,dev]"
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ ```python
51
+ import pygfm
52
+
53
+ print(pygfm.__version__)
54
+ ```
55
+
56
+ ## Package Structure
57
+
58
+ ```
59
+ pygfm/
60
+ ├── baseline_models/ # 19 GFM baseline implementations
61
+ ├── public/ # Shared utilities, losses, backbone encoders
62
+ │ ├── backbone_models/
63
+ │ ├── utils/
64
+ │ ├── cli/
65
+ │ └── model_bases.py
66
+ ├── private/ # Internal modules (core encoders, data generation)
67
+ └── cli/ # Console entrypoints
68
+ ```
69
+
70
+ ## Supported Baselines
71
+
72
+
73
+ | Category | Baselines |
74
+ | ------------------- | --------------------------------------------------------------- |
75
+ | Prompt-based GFM | MDGPT, SAMGPT, MDGFM, GraphPrompt, HGPrompt, MultiGPrompt, GCoT |
76
+ | Structure-aware | SA2GFM, Bridge, GraphKeeper, GraphMore, Graver, BIM-GFM |
77
+ | LLM-integrated | GraphGPT, GraphText, LLaGA, OneForAll |
78
+ | Retrieval-augmented | RAG-GFM |
79
+ | Classic | Classic GNN |
80
+
81
+
82
+ ## Running Experiments
83
+
84
+ Each baseline has its own experiment scripts under `scripts/<baseline>/`. Run from the repository root:
85
+
86
+ ```bash
87
+ # Pre-training
88
+ python scripts/mdgpt/pretrain.py
89
+
90
+ # Downstream fine-tuning
91
+ python scripts/sa2gfm/downstream.py
92
+
93
+ # Full pipeline with config
94
+ python scripts/gcot/pretrain.py
95
+ python scripts/gcot/finetune.py
96
+ python scripts/gcot/finetune_graph.py
97
+ ```
98
+
99
+ ## Console Commands
100
+
101
+ After installation, the following CLI commands are available:
102
+
103
+
104
+ | Command | Description |
105
+ | ----------------------- | ------------------------------------------- |
106
+ | `gfm-sa2gfm-pretrain` | SA2GFM contrastive pre-training (`-c` YAML) |
107
+ | `gfm-sa2gfm-downstream` | SA2GFM MoE downstream fine-tuning |
108
+
109
+
110
+ ## Baseline Documentation
111
+
112
+ Detailed instructions for each baseline:
113
+
114
+
115
+ | Baseline | Docs |
116
+ | ------------ | ------------------------------------------------------------------ |
117
+ | MDGPT | `[scripts/mdgpt/README.md](scripts/mdgpt/README.md)` |
118
+ | SA2GFM | `[scripts/sa2gfm/README.md](scripts/sa2gfm/README.md)` |
119
+ | MultiGPrompt | `[scripts/multigprompt/README.md](scripts/multigprompt/README.md)` |
120
+ | LLaGA | `[scripts/llaga/README.md](scripts/llaga/README.md)` |
121
+ | GraphText | `[scripts/graphtext/README.md](scripts/graphtext/README.md)` |
122
+ | GraphGPT | `[scripts/graphgpt/README.md](scripts/graphgpt/README.md)` |
123
+ | OneForAll | `[scripts/oneforall/README.md](scripts/oneforall/README.md)` |
124
+ | MDGFM | `[scripts/mdgfm/README.md](scripts/mdgfm/README.md)` |
125
+ | SAMGPT | `[scripts/samgpt/README.md](scripts/samgpt/README.md)` |
126
+ | GCoT | `[scripts/gcot/README.md](scripts/gcot/README.md)` |
127
+ | HGPrompt | `[scripts/hgprompt/README.md](scripts/hgprompt/README.md)` |
128
+ | GraphPrompt | `[scripts/graphprompt/README.md](scripts/graphprompt/README.md)` |
129
+ | Graver | `[scripts/graver/README.md](scripts/graver/README.md)` |
130
+ | GraphMore | `[scripts/graphmore/README.md](scripts/graphmore/README.md)` |
131
+ | Bridge | `[scripts/bridge/README.md](scripts/bridge/README.md)` |
132
+ | GraphKeeper | `[scripts/graphkeeper/README.md](scripts/graphkeeper/README.md)` |
133
+ | RAG-GFM | `[scripts/rag_gfm/README.md](scripts/rag_gfm/README.md)` |
134
+
135
+
136
+ ## Configuration
137
+
138
+ Experiment configs are YAML files located at `scripts/<baseline>/configs/`. Pass them via `-c` flag or as positional arguments depending on the baseline.
139
+
140
+ **Important:** Do **not** commit API keys. For baselines that require LLM API access (e.g., GraphText), copy the example config and fill in your keys locally:
141
+
142
+ ```bash
143
+ cp scripts/graphtext/config/user/env.yaml.example scripts/graphtext/config/user/env.yaml
144
+ ```
145
+
146
+ ## License
147
+
148
+ This project is licensed under the [Apache License 2.0](LICENSE).
149
+
150
+ ## Team
151
+
152
+ **MAGIC GROUP** -- Beihang University, School of Computer Science and Engineering, ACT Lab.