HKUDS / GraphGPT

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

pretrain_graph_model_path is not defined #7

Closed AriKing11 closed 11 months ago

AriKing11 commented 11 months ago

An error occurs on the line 801 of train_graph.py, that is 'pretrain_graph_model_path' is not defined.

tjb-tech commented 11 months ago

If you could give the detailed error information, we could help you better. Thank you!

tjb-tech commented 11 months ago

An error occurs on the line 801 of train_graph.py, that is 'pretrain_graph_model_path' is not defined.

By attempts by persons in our lab, I guess your question might be the error in the config.json in your base model. Specifically, if you use Vicuna as your base model, you should add two key-value pairs in the config.json as follow:

"graph_hidden_size": 128, 
"pretrain_graph_model_path": "/root/paddlejob/workspace/env_run/llm/GraphChat/"

so the complete config.json in vicuna model could be:

{
  "_name_or_path": "vicuna-7b-v1.5-16k",
  "architectures": [
    "LlamaForCausalLM"
  ],
  "bos_token_id": 1,
  "eos_token_id": 2,
  "hidden_act": "silu",
  "hidden_size": 4096,
  "initializer_range": 0.02,
  "intermediate_size": 11008,
  "max_sequence_length": 16384,
  "max_position_embeddings": 4096,
  "model_type": "llama",
  "num_attention_heads": 32,
  "num_hidden_layers": 32,
  "num_key_value_heads": 32,
  "pad_token_id": 0,
  "pretraining_tp": 1,
  "rms_norm_eps": 1e-05,
  "rope_scaling": {
    "factor": 4.0,
    "type": "linear"
  },
  "tie_word_embeddings": false,
  "torch_dtype": "float16",
  "transformers_version": "4.31.0",
  "use_cache": true,
  "vocab_size": 32000, 
  "graph_hidden_size": 128, 
  "pretrain_graph_model_path": "/root/paddlejob/workspace/env_run/llm/GraphChat/"
}
AriKing11 commented 11 months ago

Thanks for your prompt reply. It has solved my problem! BTW, do you mention this change anywhere?

tjb-tech commented 11 months ago

anywhere

Not really. I will add it in the README.md. Thank you for the supports!

AriKing11 commented 11 months ago

Would you mind explaining which model should I put in the dir "/root/paddlejob/workspace/env_run/llm/GraphChat/"

tjb-tech commented 11 months ago

Would you mind explaining which model should I put in the dir "/root/paddlejob/workspace/env_run/llm/GraphChat/"

It's just an example. Any dir that contain the pre-trained GNN is acceptable

AriKing11 commented 11 months ago

Is it ok to configure it as model in https://huggingface.co/Jiabin99/Arxiv-PubMed-GraphCLIP-GT

tjb-tech commented 11 months ago

Is it ok to configure it as model in https://huggingface.co/Jiabin99/Arxiv-PubMed-GraphCLIP-GT

Yes, you are right!