HKUDS / GraphGPT

[SIGIR'2024] "GraphGPT: Graph Instruction Tuning for Large Language Models"
https://arxiv.org/abs/2310.13023
Apache License 2.0
493 stars 36 forks source link

ModuleNotFoundError: No module named 'graphgpt' #70

Open zhuochunli opened 2 months ago

zhuochunli commented 2 months ago

When run the scripts/eval_script/graphgpt_eval.sh for evaluation, an error will occur: Traceback (most recent call last): File "./graphgpt/eval/run_graphgpt.py", line 7, in from graphgpt.conversation import conv_templates, SeparatorStyle ModuleNotFoundError: No module named 'graphgpt'

Why: this is caused by the file structure and importing problems. The folder "graphgpt" is the parent parent path of run_graphgpt.py, so we should import graphgpt from its parent parent path (../../). Hope author can solve this soon!

Solution: adding this in front of the import graphgpt:

import os
import sys
CURRENT_DIR = os.path.split(os.path.abspath(__file__))[0]  # current path
config_path = CURRENT_DIR.rsplit('/', 2)[0]  # the upper upper path
sys.path.append(config_path)
quantum-neko commented 1 month ago

You can export the path of GraphGPT into .bashrc