Commit
·
d507fa8
1
Parent(s):
6700a58
up
Browse files
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
README.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
-
This is the LoRA
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
|
| 5 |
+
# GraphJudger
|
| 6 |
|
| 7 |
+
This is the LoRA weights for the paper [Can LLMs be Good Graph Judger for Knowledge Graph Construction?](https://arxiv.org/abs/2411.17388).
|
| 8 |
|
| 9 |
+
## Example
|
| 10 |
+
|
| 11 |
+
Loading:
|
| 12 |
+
|
| 13 |
+
```python
|
| 14 |
+
BASE_MODEL = "models/llama-2-7b-hf"
|
| 15 |
+
LORA_WEIGHTS = "models/llama2-7b-lora-genwiki/"
|
| 16 |
+
|
| 17 |
+
model = LlamaForCausalLM.from_pretrained(
|
| 18 |
+
BASE_MODEL,
|
| 19 |
+
load_in_8bit=False
|
| 20 |
+
).half().cuda()
|
| 21 |
+
pipeline = transformers.pipeline (
|
| 22 |
+
"text-generation",
|
| 23 |
+
model=model,
|
| 24 |
+
tokenizer=tokenizer,
|
| 25 |
+
torch_dtype=torch.float16,
|
| 26 |
+
device=device
|
| 27 |
+
)
|
| 28 |
+
pipeline.model = PeftModel.from_pretrained(
|
| 29 |
+
model,
|
| 30 |
+
LORA_WEIGHTS,
|
| 31 |
+
torch_dtype=torch.float16,
|
| 32 |
+
).half().cuda()
|
| 33 |
+
```
|