aicinema69 commited on
Commit
c3ea048
·
verified ·
1 Parent(s): 787b484

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +134 -161
README.md CHANGED
@@ -1,199 +1,172 @@
1
  ---
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
4
  ---
 
5
 
6
- # Model Card for Model ID
 
 
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
 
 
10
 
 
11
 
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
- ## Uses
 
 
 
 
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
 
40
  ### Direct Use
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
 
 
43
 
44
- [More Information Needed]
45
 
46
- ### Downstream Use [optional]
 
 
 
 
47
 
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
 
50
- [More Information Needed]
 
 
 
 
51
 
52
- ### Out-of-Scope Use
53
 
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
 
 
 
55
 
56
- [More Information Needed]
57
 
58
- ## Bias, Risks, and Limitations
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
 
61
 
62
- [More Information Needed]
 
 
63
 
64
- ### Recommendations
 
 
 
 
 
 
65
 
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
 
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
 
69
 
70
- ## How to Get Started with the Model
 
71
 
72
- Use the code below to get started with the model.
 
 
73
 
74
- [More Information Needed]
 
 
 
 
75
 
76
  ## Training Details
77
 
78
  ### Training Data
79
 
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
 
84
  ### Training Procedure
85
 
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
1
  ---
2
  library_name: transformers
3
+ datasets:
4
+ - aicinema69/CAT-2025
5
+ language:
6
+ - en
7
+ - hi
8
+ base_model:
9
+ - NousResearch/Llama-2-7b-chat-hf
10
  ---
11
+ # CLAT Mentor LLM - Legal Reasoning Assistant
12
 
13
+ [![Hugging Face](https://img.shields.io/badge/Hugging%20Face-Model-yellow)](https://huggingface.co/aicinema69/CLAT_Mentor_LLM)
14
+ [![Task](https://img.shields.io/badge/Task-Legal%20QA-blue)]()
15
+ [![Framework](https://img.shields.io/badge/Framework-Transformers-orange)]()
16
 
17
+ ## Model Description
18
 
19
+ CLAT Mentor LLM is a specialized language model fine-tuned for the legal domain, specifically designed to assist aspirants preparing for the Common Law Admission Test (CLAT) in India. This model enhances legal reasoning capabilities and provides context-aware responses to questions related to legal concepts, case laws, and CLAT examination topics.
20
 
21
+ ## Key Capabilities
22
 
23
+ - **Legal Reasoning**: Analyzes legal scenarios and provides logical explanations
24
+ - **Case Law Analysis**: Identifies relevant precedents and explains their applications
25
+ - **CLAT Exam Guidance**: Offers targeted assistance for CLAT preparation
26
+ - **RAG-Compatible**: Optimized for Retrieval-Augmented Generation applications
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ ## Model Details
 
 
 
 
 
 
29
 
30
+ - **Developed by**: Satyam Singh
31
+ - **Model type**: Transformer-based Language Model
32
+ - **Language**: English (with some Hindi support)
33
+ - **License**: Open Source
34
+ - **Finetuned from model**: [NousResearch/Llama-2-7b-chat-hf](https://huggingface.co/NousResearch/Llama-2-7b-chat-hf)
35
 
36
+ ## Use Cases
37
 
38
  ### Direct Use
39
 
40
+ This model can be directly used for:
41
+ - Answering questions about legal concepts and principles
42
+ - Explaining case laws and their applications
43
+ - Providing guidance on CLAT exam preparation strategies
44
+ - Assisting with legal reasoning puzzles and logical deduction
45
 
46
+ ### Downstream Use
47
 
48
+ The model is optimized for integration into:
49
+ - Legal education platforms
50
+ - CLAT preparation applications
51
+ - RAG-based legal research systems
52
+ - Educational chatbots for law aspirants
53
 
54
+ ### Out-of-Scope Use
55
 
56
+ This model is not intended for:
57
+ - Providing legal advice that would replace a qualified attorney
58
+ - Generating legal documents for official use
59
+ - Making predictions about case outcomes in real legal proceedings
60
+ - Using in contexts where legal errors could have significant consequences
61
 
62
+ ## Bias, Risks, and Limitations
63
 
64
+ - The model may reflect biases present in legal education materials and case law
65
+ - It has been trained primarily on Indian legal concepts and may have limited knowledge of other legal systems
66
+ - The model should not be used as a substitute for professional legal advice
67
+ - Outputs should be verified by legal professionals for critical applications
68
 
69
+ ## Getting Started
70
 
71
+ ### Using with Transformers Library
72
 
73
+ ```python
74
+ from transformers import AutoTokenizer, AutoModelForCausalLM
75
 
76
+ # Load the model and tokenizer
77
+ tokenizer = AutoTokenizer.from_pretrained("aicinema69/CLAT_Mentor_LLM")
78
+ model = AutoModelForCausalLM.from_pretrained("aicinema69/CLAT_Mentor_LLM")
79
 
80
+ # Generate a response
81
+ prompt = "Explain the concept of precedent in Indian law."
82
+ inputs = tokenizer(prompt, return_tensors="pt")
83
+ outputs = model.generate(**inputs, max_length=200)
84
+ response = tokenizer.decode(outputs[0], skip_special_tokens=True)
85
+ print(response)
86
+ ```
87
 
88
+ ### Using with Hugging Face Inference API
89
 
90
+ ```python
91
+ import requests
92
 
93
+ API_URL = "https://api-inference.huggingface.co/models/aicinema69/CLAT_Mentor_LLM"
94
+ headers = {"Authorization": f"Bearer {API_TOKEN}"}
95
 
96
+ def query(payload):
97
+ response = requests.post(API_URL, headers=headers, json=payload)
98
+ return response.json()
99
 
100
+ output = query({
101
+ "inputs": "What topics should I focus on for the CLAT legal reasoning section?",
102
+ })
103
+ print(output)
104
+ ```
105
 
106
  ## Training Details
107
 
108
  ### Training Data
109
 
110
+ This model was fine-tuned on the specialized dataset:
111
+ - Dataset: [aicinema69/CAT-2025](https://huggingface.co/datasets/aicinema69/CAT-2025)
112
+ - Dataset includes CLAT preparation materials, legal case summaries, and curated legal reasoning Q&A pairs
113
 
114
  ### Training Procedure
115
 
116
+ - **Fine-tuning method**: PEFT/LoRA (Parameter-Efficient Fine-Tuning)
117
+ - **Base model**: NousResearch/Llama-2-7b-chat-hf
118
+ - **Training regime**: 4-bit quantization (nf4)
119
+ - **Epochs**: 5 (originally planned for 20)
120
+ - **Batch size**: 4 per device
121
+ - **Optimizer**: AdamW (paged_adamw_32bit)
122
+ - **Learning rate**: 2e-4
123
+ - **Weight decay**: 0.001
124
+ - **LR scheduler**: cosine
125
+ - **Warmup ratio**: 0.03
126
+
127
+ #### LoRA Configuration
128
+ - **LoRA attention dimension (r)**: 64
129
+ - **LoRA alpha**: 16
130
+ - **LoRA dropout**: 0.1
131
+
132
+ #### Quantization Settings
133
+ - **Precision**: 4-bit
134
+ - **Quantization type**: nf4
135
+ - **Compute dtype**: float16
136
+
137
+ ## Integration with CLAT Mentor Application
138
+
139
+ This model is a core component of the CLAT Mentor AI assistant, which combines:
140
+ - This fine-tuned LLM for domain-specific knowledge
141
+ - FAISS vector database for retrieval-augmented generation
142
+ - Streamlit-based interactive interface for user interaction
143
+
144
+ For the complete application code, visit: [GitHub Repository](https://github.com/SatyamSingh8306)
145
+
146
+ ## Citation
147
+
148
+ If you use this model in your research or application, please cite:
149
+
150
+ ```bibtex
151
+ @misc{singh2025clatmentor,
152
+ author = {Singh, Satyam},
153
+ title = {CLAT Mentor LLM: A Fine-tuned Language Model for Legal Reasoning},
154
+ year = {2025},
155
+ publisher = {Hugging Face},
156
+ howpublished = {\url{https://huggingface.co/aicinema69/CLAT_Mentor_LLM}}
157
+ }
158
+ ```
159
+
160
+ ## Contact
161
+
162
+ - **Developer**: Satyam Singh
163
+ - **LinkedIn**: [linkedin.com/in/satyam8306](https://linkedin.com/in/satyam8306)
164
+ - **GitHub**: [SatyamSingh8306](https://github.com/SatyamSingh8306)
165
+ - **Email**: satyamsingh7734@gmail.com
166
+
167
+ ## Acknowledgements
168
+
169
+ - National Law Technology Institute (NLTI) for domain expertise
170
+ - NousResearch for the base Llama-2-7b-chat-hf model
171
+ - Hugging Face for the transformers library and model hosting platforms
172
+ - The PEFT library developers for enabling efficient fine-tuning methods