Instructions to use phamthanhfd/contract-analysis-lora-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use phamthanhfd/contract-analysis-lora-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct") model = PeftModel.from_pretrained(base_model, "phamthanhfd/contract-analysis-lora-adapter") - Notebooks
- Google Colab
- Kaggle
| { | |
| "base_model": "Qwen/Qwen2.5-3B-Instruct", | |
| "lora_r": 16, | |
| "lora_alpha": 32, | |
| "lora_dropout": 0.05, | |
| "target_modules": [ | |
| "up_proj", | |
| "down_proj", | |
| "k_proj", | |
| "q_proj", | |
| "v_proj", | |
| "o_proj", | |
| "gate_proj" | |
| ], | |
| "epochs": 3, | |
| "learning_rate": 0.0002, | |
| "max_seq_length": 512, | |
| "train_samples": 2272, | |
| "eval_loss": 0.2167, | |
| "perplexity": 1.24, | |
| "categories": [ | |
| "salary", | |
| "payment", | |
| "confidentiality", | |
| "liability", | |
| "termination", | |
| "insurance", | |
| "dispute_resolution", | |
| "other" | |
| ], | |
| "system_prompt": "You are a legal contract analysis expert. Analyze the given contract clause and return a JSON object with:\n- \"category\": one of [salary, payment, confidentiality, liability, termination, insurance, dispute_resolution, other]\n- \"summary\": a concise 1-2 sentence summary of the clause\n\nReturn ONLY valid JSON, no additional text." | |
| } |