graphjudger / README.md
HaoyuHuang2's picture
up
d507fa8
metadata
license: mit

GraphJudger

This is the LoRA weights for the paper Can LLMs be Good Graph Judger for Knowledge Graph Construction?.

Example

Loading:

BASE_MODEL = "models/llama-2-7b-hf"
LORA_WEIGHTS = "models/llama2-7b-lora-genwiki/"

model = LlamaForCausalLM.from_pretrained(
            BASE_MODEL,
            load_in_8bit=False
        ).half().cuda()
pipeline = transformers.pipeline (
            "text-generation",
            model=model,
            tokenizer=tokenizer,
            torch_dtype=torch.float16,
            device=device
            )
pipeline.model = PeftModel.from_pretrained(
            model,
            LORA_WEIGHTS,
            torch_dtype=torch.float16,
        ).half().cuda()