Update README.md
Browse files
README.md
CHANGED
|
@@ -8,6 +8,11 @@ tags:
|
|
| 8 |
- grpo
|
| 9 |
- unsloth
|
| 10 |
licence: license
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
# llama-3.2-3B-GLR (GRPO Legal Reasoning)
|
| 13 |
|
|
@@ -15,6 +20,8 @@ This repository provides a Llama 3.2 3B model fine-tuned on a legal Q&A dataset
|
|
| 15 |
|
| 16 |
## Usage
|
| 17 |
|
|
|
|
|
|
|
| 18 |
```python
|
| 19 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 20 |
|
|
@@ -34,7 +41,9 @@ What are the elements of a valid contract?
|
|
| 34 |
<|start_header_id|>assistant<|end_header_id|>
|
| 35 |
"""
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
outputs = model.generate(**inputs, max_new_tokens=256)
|
| 39 |
response = tokenizer.decode(outputs[0])
|
| 40 |
print(response)
|
|
|
|
| 8 |
- grpo
|
| 9 |
- unsloth
|
| 10 |
licence: license
|
| 11 |
+
license: mit
|
| 12 |
+
datasets:
|
| 13 |
+
- axondendriteplus/legal-qna-dataset
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
---
|
| 17 |
# llama-3.2-3B-GLR (GRPO Legal Reasoning)
|
| 18 |
|
|
|
|
| 20 |
|
| 21 |
## Usage
|
| 22 |
|
| 23 |
+
Download the files first, then run the below code in inference.py
|
| 24 |
+
|
| 25 |
```python
|
| 26 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 27 |
|
|
|
|
| 41 |
<|start_header_id|>assistant<|end_header_id|>
|
| 42 |
"""
|
| 43 |
|
| 44 |
+
user_question = "What are the elements of a valid contract?"
|
| 45 |
+
system_prompt = f"""{prompt} + {user_question}"""
|
| 46 |
+
inputs = tokenizer(system_prompt, return_tensors="pt").to(model.device)
|
| 47 |
outputs = model.generate(**inputs, max_new_tokens=256)
|
| 48 |
response = tokenizer.decode(outputs[0])
|
| 49 |
print(response)
|