Closed nulinuli closed 11 months ago
import torch import os import sys sys.path.append(u'/home/fry/桌面/GraphGPT/graphgpt') from conversation import conv_templates, SeparatorStyle from transformers import CLIPVisionModel, CLIPImageProcessor, StoppingCriteria from model import * 为了找到上级目录下的模块,我用了sys.path,在修改完引用之后,运行之后又出现了其他一些找不到模块的问题,因为文件较多有点复杂不知道该怎么搞,之前把graphgpt_eval.sh以及run_graphgpt.py放在根目录里是可以运行的,但是运行一段时间后还是会有找不到模块的问题,这些文件有点复杂位置都很分散,现在不知道该如何解决了,恳请您的指点!
感谢您的反馈。graphgpt_eval.sh应该在GraphGPT的目录下运行,但不需要改变文件的位置,可以参考以下命令:
cd path/to/GraphGPT
sh path/to/graphgpt_eval.sh
谢谢您的答复,运行run_graphgpt.py会出现下列问题
(graphgpt) fry@fry-MS-7D90:~/GraphGPT$ sh ./scripts/eval_script/graphgpt_eval.sh
Traceback (most recent call last):
File "./graphgpt/eval/run_graphgpt.py", line 5, in
然后我试着将run_graphgpt.py文件放在根目录下运行之后出现下列问题
(graphgpt) fry@fry-MS-7D90:~/GraphGPT$ sh ./scripts/eval_script/graphgpt_eval.sh
2023-11-10 10:05:13,195 INFO worker.py:1673 -- Started a local Ray instance.
(eval_model pid=4924) start loading
(eval_model pid=4924) Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
(eval_model pid=4924) finish loading
(eval_model pid=4924) start loading
(eval_model pid=4924) Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Traceback (most recent call last):
File "./run_graphgpt.py", line 240, in
再次麻烦您指点一下!
import torch import os import sys sys.path.append(u'/home/fry/桌面/GraphGPT/graphgpt') from conversation import conv_templates, SeparatorStyle from transformers import CLIPVisionModel, CLIPImageProcessor, StoppingCriteria from model import * 为了找到上级目录下的模块,我用了sys.path,在修改完引用之后,运行之后又出现了其他一些找不到模块的问题,因为文件较多有点复杂不知道该怎么搞,之前把graphgpt_eval.sh以及run_graphgpt.py放在根目录里是可以运行的,但是运行一段时间后还是会有找不到模块的问题,这些文件有点复杂位置都很分散,现在不知道该如何解决了,恳请您的指点!
感谢您的反馈。graphgpt_eval.sh应该在GraphGPT的目录下运行,但不需要改变文件的位置,可以参考以下命令:
cd path/to/GraphGPT sh path/to/graphgpt_eval.sh
AssertionError: config.json missing
AssertionError: config.json missing
的问题在于您没有将pre-trained GNN放入目录中,并使得pretrain_model_path指向pre-trained GNN
我的[pre-trained GNN]是在checkpoints/stage_里面,我发现他的pretrain_graph_model_path指向如下,我并未找到该config文件,我该如何修改呢
(eval_model pid=10444) config: GraphLlamaConfig { (eval_model pid=10444) "_name_or_path": "./checkpoints/stage_2", (eval_model pid=10444) "architectures": [ (eval_model pid=10444) "GraphLlamaForCausalLM" (eval_model pid=10444) ], (eval_model pid=10444) "attention_bias": false, (eval_model pid=10444) "bos_token_id": 1, (eval_model pid=10444) "eos_token_id": 2, (eval_model pid=10444) "freeze_graph_mlp_adapter": false, (eval_model pid=10444) "graph_hidden_size": 128, (eval_model pid=10444) "graph_select_layer": -2, (eval_model pid=10444) "graph_tower": "clip_gt_arxiv_pub", (eval_model pid=10444) "hidden_act": "silu", (eval_model pid=10444) "hidden_size": 4096, (eval_model pid=10444) "initializer_range": 0.02, (eval_model pid=10444) "intermediate_size": 11008, (eval_model pid=10444) "max_position_embeddings": 4096, (eval_model pid=10444) "max_sequence_length": 16384, (eval_model pid=10444) "model_type": "GraphLlama", (eval_model pid=10444) "num_attention_heads": 32, (eval_model pid=10444) "num_hidden_layers": 32, (eval_model pid=10444) "num_key_value_heads": 32, (eval_model pid=10444) "pad_token_id": 0, (eval_model pid=10444) "pretrain_graph_model_path": "./clip_gt_arxiv_pub", (eval_model pid=10444) "pretraining_tp": 1, (eval_model pid=10444) "rms_norm_eps": 1e-05, (eval_model pid=10444) "rope_scaling": { (eval_model pid=10444) "factor": 4.0, (eval_model pid=10444) "type": "linear" (eval_model pid=10444) }, (eval_model pid=10444) "rope_theta": 10000.0, (eval_model pid=10444) "sep_graph_conv_front": false, (eval_model pid=10444) "tie_word_embeddings": false, (eval_model pid=10444) "torch_dtype": "float32", (eval_model pid=10444) "transformers_version": "4.34.1", (eval_model pid=10444) "tune_graph_mlp_adapter": true, (eval_model pid=10444) "use_cache": true, (eval_model pid=10444) "use_graph_proj": true, (eval_model pid=10444) "use_graph_start_end": true, (eval_model pid=10444) "vocab_size": 32003 (eval_model pid=10444) } (eval_model pid=10444)
AssertionError: config.json missing
AssertionError: config.json missing
的问题在于您没有将pre-trained GNN放入目录中,并使得pretrain_model_path指向pre-trained GNN
可以直接修改直接修改载入checkpoint的config.json文件
我的[pre-trained GNN]是在checkpoints/stage_里面,我发现他的pretrain_graph_model_path指向如下,我并未找到该config文件,我该如何修改呢
(eval_model pid=10444) config: GraphLlamaConfig { (eval_model pid=10444) "_name_or_path": "./checkpoints/stage_2", (eval_model pid=10444) "architectures": [ (eval_model pid=10444) "GraphLlamaForCausalLM" (eval_model pid=10444) ], (eval_model pid=10444) "attention_bias": false, (eval_model pid=10444) "bos_token_id": 1, (eval_model pid=10444) "eos_token_id": 2, (eval_model pid=10444) "freeze_graph_mlp_adapter": false, (eval_model pid=10444) "graph_hidden_size": 128, (eval_model pid=10444) "graph_select_layer": -2, (eval_model pid=10444) "graph_tower": "clip_gt_arxiv_pub", (eval_model pid=10444) "hidden_act": "silu", (eval_model pid=10444) "hidden_size": 4096, (eval_model pid=10444) "initializer_range": 0.02, (eval_model pid=10444) "intermediate_size": 11008, (eval_model pid=10444) "max_position_embeddings": 4096, (eval_model pid=10444) "max_sequence_length": 16384, (eval_model pid=10444) "model_type": "GraphLlama", (eval_model pid=10444) "num_attention_heads": 32, (eval_model pid=10444) "num_hidden_layers": 32, (eval_model pid=10444) "num_key_value_heads": 32, (eval_model pid=10444) "pad_token_id": 0, (eval_model pid=10444) "pretrain_graph_model_path": "./clip_gt_arxiv_pub", (eval_model pid=10444) "pretraining_tp": 1, (eval_model pid=10444) "rms_norm_eps": 1e-05, (eval_model pid=10444) "rope_scaling": { (eval_model pid=10444) "factor": 4.0, (eval_model pid=10444) "type": "linear" (eval_model pid=10444) }, (eval_model pid=10444) "rope_theta": 10000.0, (eval_model pid=10444) "sep_graph_conv_front": false, (eval_model pid=10444) "tie_word_embeddings": false, (eval_model pid=10444) "torch_dtype": "float32", (eval_model pid=10444) "transformers_version": "4.34.1", (eval_model pid=10444) "tune_graph_mlp_adapter": true, (eval_model pid=10444) "use_cache": true, (eval_model pid=10444) "use_graph_proj": true, (eval_model pid=10444) "use_graph_start_end": true, (eval_model pid=10444) "vocab_size": 32003 (eval_model pid=10444) } (eval_model pid=10444)
AssertionError: config.json missing
AssertionError: config.json missing
的问题在于您没有将pre-trained GNN放入目录中,并使得pretrain_model_path指向pre-trained GNN
我已收到你的信啦!
我的[pre-trained GNN]是在checkpoints/stage_里面,我发现他的pretrain_graph_model_path指向如下,我并未找到该config文件,我该如何修改呢
(eval_model pid=10444) config: GraphLlamaConfig { (eval_model pid=10444) "_name_or_path": "./checkpoints/stage_2", (eval_model pid=10444) "architectures": [ (eval_model pid=10444) "GraphLlamaForCausalLM" (eval_model pid=10444) ], (eval_model pid=10444) "attention_bias": false, (eval_model pid=10444) "bos_token_id": 1, (eval_model pid=10444) "eos_token_id": 2, (eval_model pid=10444) "freeze_graph_mlp_adapter": false, (eval_model pid=10444) "graph_hidden_size": 128, (eval_model pid=10444) "graph_select_layer": -2, (eval_model pid=10444) "graph_tower": "clip_gt_arxiv_pub", (eval_model pid=10444) "hidden_act": "silu", (eval_model pid=10444) "hidden_size": 4096, (eval_model pid=10444) "initializer_range": 0.02, (eval_model pid=10444) "intermediate_size": 11008, (eval_model pid=10444) "max_position_embeddings": 4096, (eval_model pid=10444) "max_sequence_length": 16384, (eval_model pid=10444) "model_type": "GraphLlama", (eval_model pid=10444) "num_attention_heads": 32, (eval_model pid=10444) "num_hidden_layers": 32, (eval_model pid=10444) "num_key_value_heads": 32, (eval_model pid=10444) "pad_token_id": 0, (eval_model pid=10444) "pretrain_graph_model_path": "./clip_gt_arxiv_pub", (eval_model pid=10444) "pretraining_tp": 1, (eval_model pid=10444) "rms_norm_eps": 1e-05, (eval_model pid=10444) "rope_scaling": { (eval_model pid=10444) "factor": 4.0, (eval_model pid=10444) "type": "linear" (eval_model pid=10444) }, (eval_model pid=10444) "rope_theta": 10000.0, (eval_model pid=10444) "sep_graph_conv_front": false, (eval_model pid=10444) "tie_word_embeddings": false, (eval_model pid=10444) "torch_dtype": "float32", (eval_model pid=10444) "transformers_version": "4.34.1", (eval_model pid=10444) "tune_graph_mlp_adapter": true, (eval_model pid=10444) "use_cache": true, (eval_model pid=10444) "use_graph_proj": true, (eval_model pid=10444) "use_graph_start_end": true, (eval_model pid=10444) "vocab_size": 32003 (eval_model pid=10444) } (eval_model pid=10444)
AssertionError: config.json missing
AssertionError: config.json missing
的问题在于您没有将pre-trained GNN放入目录中,并使得pretrain_model_path指向pre-trained GNN
请问是如何修改的呢?我修改二阶段checkpoint中的config.json还是报这个错误
import torch import os import sys sys.path.append(u'/home/fry/桌面/GraphGPT/graphgpt') from conversation import conv_templates, SeparatorStyle from transformers import CLIPVisionModel, CLIPImageProcessor, StoppingCriteria from model import * 为了找到上级目录下的模块,我用了sys.path,在修改完引用之后,运行之后又出现了其他一些找不到模块的问题,因为文件较多有点复杂不知道该怎么搞,之前把graphgpt_eval.sh以及run_graphgpt.py放在根目录里是可以运行的,但是运行一段时间后还是会有找不到模块的问题,这些文件有点复杂位置都很分散,现在不知道该如何解决了,恳请您的指点!