busybisi commited on
Commit
970473c
·
verified ·
1 Parent(s): 068f167

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +127 -38
README.md CHANGED
@@ -1,60 +1,149 @@
1
  ---
2
- library_name: peft
3
- license: other
4
- base_model: Qwen/Qwen2.5-3B-Instruct
 
5
  tags:
6
- - base_model:adapter:Qwen/Qwen2.5-3B-Instruct
 
 
 
 
 
7
  - lora
8
- - transformers
 
9
  pipeline_tag: text-generation
10
- model-index:
11
- - name: DoloresAI-Qwen25
12
- results: []
 
 
 
 
 
 
13
  ---
14
 
15
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
16
- should probably proofread and complete it, then remove this comment. -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- # DoloresAI-Qwen25
 
 
 
19
 
20
- This model is a fine-tuned version of [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct) on an unknown dataset.
 
21
 
22
- ## Model description
 
 
 
 
 
23
 
24
- More information needed
 
25
 
26
- ## Intended uses & limitations
 
27
 
28
- More information needed
29
 
30
- ## Training and evaluation data
 
31
 
32
- More information needed
33
 
34
- ## Training procedure
 
 
 
 
 
35
 
36
- ### Training hyperparameters
37
 
38
- The following hyperparameters were used during training:
39
- - learning_rate: 0.0002
40
- - train_batch_size: 4
41
- - eval_batch_size: 4
42
- - seed: 42
43
- - gradient_accumulation_steps: 4
44
- - total_train_batch_size: 16
45
- - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
46
- - lr_scheduler_type: linear
47
- - lr_scheduler_warmup_steps: 100
48
- - num_epochs: 3
49
 
50
- ### Training results
 
 
51
 
 
52
 
 
53
 
54
- ### Framework versions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
- - PEFT 0.18.0
57
- - Transformers 4.57.3
58
- - Pytorch 2.9.0+cu126
59
- - Datasets 4.0.0
60
- - Tokenizers 0.22.2
 
1
  ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ library_name: transformers
6
  tags:
7
+ - legal
8
+ - immigration
9
+ - assistant
10
+ - qwen2
11
+ - qwen2.5
12
+ - fine-tuned
13
  - lora
14
+ base_model: Qwen/Qwen2.5-3B-Instruct
15
+ model_type: qwen2
16
  pipeline_tag: text-generation
17
+ widget:
18
+ - text: "What is an H-1B visa?"
19
+ example_title: "H-1B Visa Question"
20
+ - text: "How do I apply for a green card?"
21
+ example_title: "Green Card Process"
22
+ - text: "What documents do I need for an O-1 visa?"
23
+ example_title: "O-1 Visa Requirements"
24
+ datasets:
25
+ - busybisi/dolores-training-data
26
  ---
27
 
28
+ # Dolores AI - Immigration Case Manager (Qwen 2.5 LoRA)
29
+
30
+ Dolores is a specialized AI Immigration Case Manager fine-tuned using LoRA (Low-Rank Adaptation) on Qwen 2.5-3B-Instruct. Her mission is to de-mystify the complex immigration journey, breaking it down into manageable, actionable steps with high empathy and precision.
31
+
32
+ ## Model Details
33
+
34
+ - **Base Model**: [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct)
35
+ - **Fine-tuning Method**: LoRA (Low-Rank Adaptation)
36
+ - **LoRA Rank**: 16
37
+ - **LoRA Alpha**: 32
38
+ - **Training Data**: Immigration law documents, case examples, and expert guidance
39
+ - **Use Case**: Immigration consultation, visa guidance, document preparation
40
+ - **Model Size**: ~3B parameters (LoRA adapter only)
41
+
42
+ ## Training Details
43
+
44
+ ### Training Configuration
45
+ - **Epochs**: 3
46
+ - **Batch Size**: 4 (effective: 16 with gradient accumulation)
47
+ - **Learning Rate**: 2e-4
48
+ - **Quantization**: 4-bit (QLoRA) during training
49
+ - **Max Sequence Length**: 2048 tokens
50
+ - **Target Modules**: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
51
+
52
+ ### Training Data
53
+ Fine-tuned on curated immigration law datasets including:
54
+ - U.S. immigration policies and procedures
55
+ - Visa types and requirements (H-1B, O-1, EB-1, etc.)
56
+ - Green card processes
57
+ - Case examples and expert guidance
58
+ - Document preparation instructions
59
+
60
+ ## Usage
61
+
62
+ This is a **LoRA adapter** that needs to be loaded with the base model. For production use, see the merged version: [JustiGuide/DoloresAI-Qwen25-Merged](https://huggingface.co/JustiGuide/DoloresAI-Qwen25-Merged)
63
+
64
+ ### Loading the LoRA Adapter
65
 
66
+ ```python
67
+ from transformers import AutoModelForCausalLM, AutoTokenizer
68
+ from peft import PeftModel
69
+ import torch
70
 
71
+ base_model_id = "Qwen/Qwen2.5-3B-Instruct"
72
+ lora_adapter_id = "JustiGuide/DoloresAI-Qwen25"
73
 
74
+ # Load base model
75
+ model = AutoModelForCausalLM.from_pretrained(
76
+ base_model_id,
77
+ torch_dtype=torch.bfloat16,
78
+ device_map="auto"
79
+ )
80
 
81
+ # Load LoRA adapter
82
+ model = PeftModel.from_pretrained(model, lora_adapter_id)
83
 
84
+ tokenizer = AutoTokenizer.from_pretrained(base_model_id)
85
+ ```
86
 
87
+ ### Inference Example
88
 
89
+ ```python
90
+ system_prompt = "You are Dolores, a specialized AI Immigration Case Manager."
91
 
92
+ question = "What is an H-1B visa and who qualifies for it?"
93
 
94
+ prompt = f'''<|im_start|>system
95
+ {system_prompt}<|im_end|>
96
+ <|im_start|>user
97
+ {question}<|im_end|>
98
+ <|im_start|>assistant
99
+ '''
100
 
101
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
102
 
103
+ outputs = model.generate(
104
+ **inputs,
105
+ max_new_tokens=512,
106
+ temperature=0.7,
107
+ top_p=0.9,
108
+ do_sample=True,
109
+ repetition_penalty=1.1,
110
+ )
 
 
 
111
 
112
+ response = tokenizer.decode(outputs[0], skip_special_tokens=True)
113
+ print(response)
114
+ ```
115
 
116
+ ## Deployment
117
 
118
+ For production deployment, use the merged model: [JustiGuide/DoloresAI-Qwen25-Merged](https://huggingface.co/JustiGuide/DoloresAI-Qwen25-Merged)
119
 
120
+ ### HuggingFace Inference Endpoint
121
+ - GPU: Nvidia L4 (24GB VRAM)
122
+ - Scale to Zero: Enabled
123
+ - Region: us-east-1
124
+
125
+ ## Performance
126
+
127
+ - **Inference Speed**: ~10-20 tokens/second (on L4 GPU)
128
+ - **Context Length**: Up to 2048 tokens
129
+ - **Quality**: High accuracy on immigration-specific questions
130
+
131
+ ## Limitations
132
+
133
+ - Provides general immigration guidance, **not legal advice**
134
+ - Always consult with a licensed immigration attorney for specific cases
135
+ - Trained primarily on U.S. immigration law
136
+ - May not have information on very recent policy changes
137
+
138
+ ## License
139
+
140
+ Apache 2.0 License (following base model's license)
141
+
142
+ ## Contact
143
+
144
+ - **Organization**: JustiGuide
145
+ - **Website**: https://justi.guide
146
+
147
+ ---
148
 
149
+ **Built with ❤️ by JustiGuide to make immigration more accessible**