CoolFace
Modelpublic

sxiong/TG-LLM-TGQA-Story2TG-Llama-2-13B-LoRA

sourceHugging Facemitupdated 16d agoView on Hugging Face
0likes39downloads
Model Card

Model Card for TG-LLM

TG-LLM consists of supervised fine-tuned models designed for temporal reasoning with large language models (LLMs). It includes two primary tasks:

  1. 1.Story-to-Temporal-Graph Translation (story_TG_trans) – converting a narrative into its corresponding temporal graph.
  2. 2.Temporal-Graph Reasoning (TGR) – reasoning over a given temporal graph to answer questions.

Model Details

TGQA_story_TG_trans
  • —Base Model: meta-llama/Llama-2-13b-chat-hf
  • —LoRA Configuration:
  • —lora_alpha: 8
  • —r: 8
  • —target_modules: ["q_proj", "k_proj", "o_proj", "v_proj"]
  • —bias: "none"

For more details, please visit the TG-LLM GitHub repository.

Loading the adapter

python
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_id = "meta-llama/Llama-2-13b-chat-hf"
adapter_id = "sxiong/TG-LLM-TGQA-Story2TG-Llama-2-13B-LoRA"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)

base_model = AutoModelForCausalLM.from_pretrained(
    base_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()

Citation

@inproceedings{xiong2024large,
  title={Large language models can learn temporal reasoning},
  author={Xiong, Siheng and Payani, Ali and Kompella, Ramana and Fekri, Faramarz},
  booktitle={Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  pages={10452--10470},
  year={2024}
}