HKUDS / GraphGPT

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

关于找不到config.json文件 #14

Closed nulinuli closed 1 year ago

nulinuli commented 1 year ago

2023-11-09 16:41:33,050 INFO worker.py:1673 -- Started a local Ray instance. (eval_model pid=11217) Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. (eval_model pid=11217) start loading Traceback (most recent call last): File "./run_graphgpt.py", line 240, in run_eval(args, args.num_gpus) File "./run_graphgpt.py", line 94, in run_eval ans_jsons.extend(ray.get(ans_handle)) File "/home/fry/.conda/envs/graphgpt/lib/python3.8/site-packages/ray/_private/auto_init_hook.py", line 24, in auto_init_wrapper return fn(*args, kwargs) File "/home/fry/.conda/envs/graphgpt/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper return func(*args, *kwargs) File "/home/fry/.conda/envs/graphgpt/lib/python3.8/site-packages/ray/_private/worker.py", line 2563, in get raise value.as_instanceof_cause() ray.exceptions.RayTaskError(AssertionError): ray::eval_model() (pid=11217, ip=172.27.37.124) File "/home/fry/.conda/envs/graphgpt/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(args, kwargs) File "./run_graphgpt.py", line 116, in eval_model model = GraphLlamaForCausalLM.from_pretrained(args.model_name, torch_dtype=torch.float16, use_cache=True, low_cpu_mem_usage=True).cuda() File "/home/fry/.conda/envs/graphgpt/lib/python3.8/site-packages/transformers/modeling_utils.py", line 3085, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/home/fry/桌面/GraphGPT-main/graphgpt/model/GraphLlama.py", line 284, in init self.model = GraphLlamaModel(config) File "/home/fry/桌面/GraphGPT-main/graphgpt/model/GraphLlama.py", line 104, in init clip_graph, args= load_model_pretrained(CLIP, config.pretrain_graph_model_path) File "/home/fry/桌面/GraphGPT-main/graphgpt/model/GraphLlama.py", line 55, in load_model_pretrained assert osp.exists(osp.join(pretrain_model_path, 'config.json')), 'config.json missing' AssertionError: config.json missing (eval_model pid=11217) Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. (eval_model pid=11217) finish loading (eval_model pid=11217) start loading 我下载的是您的checkpoints

zhuochunli commented 6 months ago

你好,请问解决了吗?我也是在evaluation方面出了这个问题

Longmeix commented 6 months ago

我也遇到了这个问题,请问有人解决了吗

daixixiwang commented 3 months ago

这个作者有个小错误,脚本中和实际目录结构下的名字不一致,手动改下就可以了 。

xvrrr commented 1 month ago

我也在eval阶段遇到了这个问题,原因是config.json里的graph_tower,pretrain_graph_model_path和clip_gt_arxiv的文件路径指向不一致,通过更改文件路径解决,以下是我在eval阶段使用的config.json 和 clip_gt_arxiv路径:{ "_name_or_path": "./vicuna-7b-v1.5-16k", "architectures": [ "GraphLlamaForCausalLM" ], "bos_token_id": 1, "eos_token_id": 2, "freeze_graph_mlp_adapter": false, "graph_hidden_size": 128, "graph_select_layer": -2, "graph_tower": "clip_gt_arxiv_pub", "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "max_position_embeddings": 4096, "max_sequence_length": 16384, "model_type": "GraphLlama", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "pad_token_id": 0, "pretrain_graph_model_path": "/root/autodl-tmp/GraphGPT/clip_gt_arxiv_pub", "pretraining_tp": 1, "rms_norm_eps": 1e-05, "rope_scaling": { "factor": 4.0, "type": "linear" }, "sep_graph_conv_front": false, "tie_word_embeddings": false, "torch_dtype": "float32", "transformers_version": "4.31.0", "tune_graph_mlp_adapter": true, "use_cache": false, "use_graph_proj": true, "use_graph_start_end": true, "vocab_size": 32003

}

image

xvrrr commented 1 month ago

我也遇到了这个问题,请问有人解决了吗

可以试试这样设置路径

Longmeix commented 1 month ago

谢谢你们详细的回答,我后续解决了这个问题

CigarOVO commented 1 month ago

我也在eval阶段遇到了这个问题,原因是config.json里的graph_tower,pretrain_graph_model_path和clip_gt_arxiv的文件路径指向不一致,通过更改文件路径解决,以下是我在eval阶段使用的config.json 和 clip_gt_arxiv路径:{ "_name_or_path": "./vicuna-7b-v1.5-16k", "architectures": [ "GraphLlamaForCausalLM" ], "bos_token_id": 1, "eos_token_id": 2, "freeze_graph_mlp_adapter": false, "graph_hidden_size": 128, "graph_select_layer": -2, "graph_tower": "clip_gt_arxiv_pub", "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "max_position_embeddings": 4096, "max_sequence_length": 16384, "model_type": "GraphLlama", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "pad_token_id": 0, "pretrain_graph_model_path": "/root/autodl-tmp/GraphGPT/clip_gt_arxiv_pub", "pretraining_tp": 1, "rms_norm_eps": 1e-05, "rope_scaling": { "factor": 4.0, "type": "linear" }, "sep_graph_conv_front": false, "tie_word_embeddings": false, "torch_dtype": "float32", "transformers_version": "4.31.0", "tune_graph_mlp_adapter": true, "use_cache": false, "use_graph_proj": true, "use_graph_start_end": true, "vocab_size": 32003

}

image

您好,我也遇到了同样的问题,报错内容为:

Traceback (most recent call last): File "./graphgpt/eval/run_graphgpt.py", line 244, in run_eval(args, args.num_gpus) File "./graphgpt/eval/run_graphgpt.py", line 98, in run_eval ans_jsons.extend(ray.get(ans_handle)) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/auto_init_hook.py", line 24, in auto_init_wrapper return fn(*args, kwargs) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper return func(*args, *kwargs) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/worker.py", line 2493, in get raise value.as_instanceof_cause() ray.exceptions.RayTaskError(AssertionError): ray::eval_model() (pid=2040388, ip=172.16.10.18) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(args, kwargs) File "./graphgpt/eval/run_graphgpt.py", line 120, in eval_model model = GraphLlamaForCausalLM.from_pretrained(args.model_name, torch_dtype=torch.float16, use_cache=True, low_cpu_mem_usage=True).cuda() File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2700, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 283, in init self.model = GraphLlamaModel(config) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 99, in init clip_graph, args= load_model_pretrained(CLIP, config.pretrain_graph_model_path) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 54, in load_model_pretrained assert osp.exists(osp.join(pretrain_model_path, 'config.json')), 'config.json missing' AssertionError: config.json missing

graphgpt_eval.sh参数设置为:

output_model=/root/GraphGPT/output/stage_2/ datapath=/root/GraphGPT/graph_data/arxiv_test_instruct_cot.json graph_data_path=/root/GraphGPT/graph_data/graph_data_all.pt res_path=/root/GraphGPT/output/output_stage_2_arxiv_nc

我修改了/root/GraphGPT/output/stage_2/config.json文件的内容为

{ "_name_or_path": "/root/vicuna-7b-v1.5-16k", "architectures": [ "GraphLlamaForCausalLM" ], "bos_token_id": 1, "eos_token_id": 2, "freeze_graph_mlp_adapter": false, "graph_hidden_size": 128, "graph_select_layer": -2, "graph_tower": "clip_gt_arxiv", "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "max_position_embeddings": 4096, "max_sequence_length": 16384, "model_type": "GraphLlama", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "pad_token_id": 0, "pretrain_graph_model_path": "/root/GraphGPT/pretrained_gnn/clip_gt_arxiv", "pretraining_tp": 1, "rms_norm_eps": 1e-05, "rope_scaling": { "factor": 4.0, "type": "linear" }, "sep_graph_conv_front": false, "tie_word_embeddings": false, "torch_dtype": "float32", "transformers_version": "4.31.0", "tune_graph_mlp_adapter": true, "use_cache": false, "use_graph_proj": true, "use_graph_start_end": true, "vocab_size": 32003 } 我的目录结构为/root/GraphGPT/pretrained_gnn/clip_gt_arxiv/clip_gt_arxiv_pub.pkl 按照您的思路修改还是不对,请问我是哪里改错了吗?

xvrrr commented 1 month ago

我也在eval阶段遇到了这个问题,原因是config.json里的graph_tower,pretrain_graph_model_path和clip_gt_arxiv的文件路径指向不一致,通过更改文件路径解决,以下是我在eval阶段使用的config.json 和 clip_gt_arxiv路径:{ "_name_or_path": "./vicuna-7b-v1.5-16k", "architectures": [ "GraphLlamaForCausalLM" ], "bos_token_id": 1, "eos_token_id": 2, "freeze_graph_mlp_adapter": false, "graph_hidden_size": 128, "graph_select_layer": -2, "graph_tower": "clip_gt_arxiv_pub", "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "max_position_embeddings": 4096, "max_sequence_length": 16384, "model_type": "GraphLlama", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "pad_token_id": 0, "pretrain_graph_model_path": "/root/autodl-tmp/GraphGPT/clip_gt_arxiv_pub", "pretraining_tp": 1, "rms_norm_eps": 1e-05, "rope_scaling": { "factor": 4.0, "type": "linear" }, "sep_graph_conv_front": false, "tie_word_embeddings": false, "torch_dtype": "float32", "transformers_version": "4.31.0", "tune_graph_mlp_adapter": true, "use_cache": false, "use_graph_proj": true, "use_graph_start_end": true, "vocab_size": 32003 } image

您好,我也遇到了同样的问题,报错内容为:

Traceback (most recent call last): File "./graphgpt/eval/run_graphgpt.py", line 244, in run_eval(args, args.num_gpus) File "./graphgpt/eval/run_graphgpt.py", line 98, in run_eval ans_jsons.extend(ray.get(ans_handle)) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/auto_init_hook.py", line 24, in auto_init_wrapper return fn(*args, kwargs) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper return func(*args, *kwargs) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/worker.py", line 2493, in get raise value.as_instanceof_cause() ray.exceptions.RayTaskError(AssertionError): ray::eval_model() (pid=2040388, ip=172.16.10.18) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(args, kwargs) File "./graphgpt/eval/run_graphgpt.py", line 120, in eval_model model = GraphLlamaForCausalLM.from_pretrained(args.model_name, torch_dtype=torch.float16, use_cache=True, low_cpu_mem_usage=True).cuda() File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2700, in from_pretrained model = cls(config, *model_args, model_kwargs) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 283, in init self.model = GraphLlamaModel(config) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 99, in init** clip_graph, args= load_model_pretrained(CLIP, config.pretrain_graph_model_path) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 54, in load_model_pretrained assert osp.exists(osp.join(pretrain_model_path, 'config.json')), 'config.json missing' AssertionError: config.json missing

graphgpt_eval.sh参数设置为:

output_model=/root/GraphGPT/output/stage_2/ datapath=/root/GraphGPT/graph_data/arxiv_test_instruct_cot.json graph_data_path=/root/GraphGPT/graph_data/graph_data_all.pt res_path=/root/GraphGPT/output/output_stage_2_arxiv_nc

我修改了/root/GraphGPT/output/stage_2/config.json文件的内容为

{ "_name_or_path": "/root/vicuna-7b-v1.5-16k", "architectures": [ "GraphLlamaForCausalLM" ], "bos_token_id": 1, "eos_token_id": 2, "freeze_graph_mlp_adapter": false, "graph_hidden_size": 128, "graph_select_layer": -2, "graph_tower": "clip_gt_arxiv", "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "max_position_embeddings": 4096, "max_sequence_length": 16384, "model_type": "GraphLlama", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "pad_token_id": 0, "pretrain_graph_model_path": "/root/GraphGPT/pretrained_gnn/clip_gt_arxiv", "pretraining_tp": 1, "rms_norm_eps": 1e-05, "rope_scaling": { "factor": 4.0, "type": "linear" }, "sep_graph_conv_front": false, "tie_word_embeddings": false, "torch_dtype": "float32", "transformers_version": "4.31.0", "tune_graph_mlp_adapter": true, "use_cache": false, "use_graph_proj": true, "use_graph_start_end": true, "vocab_size": 32003 } 我的目录结构为/root/GraphGPT/pretrained_gnn/clip_gt_arxiv/clip_gt_arxiv_pub.pkl 按照您的思路修改还是不对,请问我是哪里改错了吗?

image

您试试将GraphGPT/clip_gt_arxiv_pub 的总文件夹直接放在GraphGPT下 (clip_gt_arxiv_pub包括上图内容),不使用GraphGPT/pretrained_gnn/clip_gt_arxiv/clip_gt_arxiv_pub.pkl 这个文件路径。再将eval的config.json 里这两行设置为"pretrain_graph_model_path": "/root/autodl-tmp/GraphGPT/clip_gt_arxiv_pub"; "graph_tower": "clip_gt_arxiv_pub"

CigarOVO commented 1 month ago

我也在eval阶段遇到了这个问题,原因是config.json里的graph_tower,pretrain_graph_model_path和clip_gt_arxiv的文件路径指向不一致,通过更改文件路径解决,以下是我在eval阶段使用的config.json 和 clip_gt_arxiv路径:{ "_name_or_path": "./vicuna-7b-v1.5-16k", "architectures": [ "GraphLlamaForCausalLM" ], "bos_token_id": 1, "eos_token_id": 2, "freeze_graph_mlp_adapter": false, "graph_hidden_size": 128, "graph_select_layer": -2, "graph_tower": "clip_gt_arxiv_pub", "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "max_position_embeddings": 4096, "max_sequence_length": 16384, "model_type": "GraphLlama", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "pad_token_id": 0, "pretrain_graph_model_path": "/root/autodl-tmp/GraphGPT/clip_gt_arxiv_pub", "pretraining_tp": 1, "rms_norm_eps": 1e-05, "rope_scaling": { "factor": 4.0, "type": "linear" }, "sep_graph_conv_front": false, "tie_word_embeddings": false, "torch_dtype": "float32", "transformers_version": "4.31.0", "tune_graph_mlp_adapter": true, "use_cache": false, "use_graph_proj": true, "use_graph_start_end": true, "vocab_size": 32003 } image

您好,我也遇到了同样的问题,报错内容为: Traceback (most recent call last): File "./graphgpt/eval/run_graphgpt.py", line 244, in run_eval(args, args.num_gpus) File "./graphgpt/eval/run_graphgpt.py", line 98, in run_eval ans_jsons.extend(ray.get(ans_handle)) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/auto_init_hook.py", line 24, in auto_init_wrapper return fn(*args, kwargs) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper return func(*args, *kwargs) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/ray/_private/worker.py", line 2493, in get raise value.as_instanceof_cause() ray.exceptions.RayTaskError(AssertionError): ray::eval_model() (pid=2040388, ip=172.16.10.18) File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(args, kwargs) File "./graphgpt/eval/run_graphgpt.py", line 120, in eval_model model = GraphLlamaForCausalLM.from_pretrained(args.model_name, torch_dtype=torch.float16, use_cache=True, low_cpu_mem_usage=True).cuda() File "/root/miniconda3/envs/graphgpt/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2700, in from_pretrained model = cls(config, *model_args, model_kwargs) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 283, in init self.model = GraphLlamaModel(config) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 99, in init** clip_graph, args= load_model_pretrained(CLIP, config.pretrain_graph_model_path) File "/root/GraphGPT/graphgpt/model/GraphLlama.py", line 54, in load_model_pretrained assert osp.exists(osp.join(pretrain_model_path, 'config.json')), 'config.json missing' AssertionError: config.json missing graphgpt_eval.sh参数设置为: output_model=/root/GraphGPT/output/stage_2/ datapath=/root/GraphGPT/graph_data/arxiv_test_instruct_cot.json graph_data_path=/root/GraphGPT/graph_data/graph_data_all.pt res_path=/root/GraphGPT/output/output_stage_2_arxiv_nc 我修改了/root/GraphGPT/output/stage_2/config.json文件的内容为 { "_name_or_path": "/root/vicuna-7b-v1.5-16k", "architectures": [ "GraphLlamaForCausalLM" ], "bos_token_id": 1, "eos_token_id": 2, "freeze_graph_mlp_adapter": false, "graph_hidden_size": 128, "graph_select_layer": -2, "graph_tower": "clip_gt_arxiv", "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "max_position_embeddings": 4096, "max_sequence_length": 16384, "model_type": "GraphLlama", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "pad_token_id": 0, "pretrain_graph_model_path": "/root/GraphGPT/pretrained_gnn/clip_gt_arxiv", "pretraining_tp": 1, "rms_norm_eps": 1e-05, "rope_scaling": { "factor": 4.0, "type": "linear" }, "sep_graph_conv_front": false, "tie_word_embeddings": false, "torch_dtype": "float32", "transformers_version": "4.31.0", "tune_graph_mlp_adapter": true, "use_cache": false, "use_graph_proj": true, "use_graph_start_end": true, "vocab_size": 32003 } 我的目录结构为/root/GraphGPT/pretrained_gnn/clip_gt_arxiv/clip_gt_arxiv_pub.pkl 按照您的思路修改还是不对,请问我是哪里改错了吗?

image

您试试将GraphGPT/clip_gt_arxiv_pub 的总文件夹直接放在GraphGPT下 (clip_gt_arxiv_pub包括上图内容),不使用GraphGPT/pretrained_gnn/clip_gt_arxiv/clip_gt_arxiv_pub.pkl 这个文件路径。再将eval的config.json 里这两行设置为"pretrain_graph_model_path": "/root/autodl-tmp/GraphGPT/clip_gt_arxiv_pub"; "graph_tower": "clip_gt_arxiv_pub"

十分感谢!解决了,因为之前第一阶段训练的时候直接放入GraphGPT文件夹下报错,嵌套了一层成功了,没想到eval的时候又得改回来(;´д`)ゞ