DisgustingOzil
commited on
Commit
•
d8cfa9b
1
Parent(s):
1668d7c
Update README.md
Browse files
README.md
CHANGED
@@ -4,199 +4,70 @@ tags:
|
|
4 |
- unsloth
|
5 |
---
|
6 |
|
7 |
-
#
|
8 |
|
9 |
<!-- Provide a quick summary of what the model is/does. -->
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
Use the code below to get started with the model.
|
74 |
-
|
75 |
-
[More Information Needed]
|
76 |
-
|
77 |
-
## Training Details
|
78 |
-
|
79 |
-
### Training Data
|
80 |
-
|
81 |
-
<!-- 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. -->
|
82 |
-
|
83 |
-
[More Information Needed]
|
84 |
-
|
85 |
-
### Training Procedure
|
86 |
-
|
87 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
88 |
-
|
89 |
-
#### Preprocessing [optional]
|
90 |
-
|
91 |
-
[More Information Needed]
|
92 |
-
|
93 |
-
|
94 |
-
#### Training Hyperparameters
|
95 |
-
|
96 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
97 |
-
|
98 |
-
#### Speeds, Sizes, Times [optional]
|
99 |
-
|
100 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
101 |
-
|
102 |
-
[More Information Needed]
|
103 |
-
|
104 |
-
## Evaluation
|
105 |
-
|
106 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
107 |
-
|
108 |
-
### Testing Data, Factors & Metrics
|
109 |
-
|
110 |
-
#### Testing Data
|
111 |
-
|
112 |
-
<!-- This should link to a Dataset Card if possible. -->
|
113 |
-
|
114 |
-
[More Information Needed]
|
115 |
-
|
116 |
-
#### Factors
|
117 |
-
|
118 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
119 |
-
|
120 |
-
[More Information Needed]
|
121 |
-
|
122 |
-
#### Metrics
|
123 |
-
|
124 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
125 |
-
|
126 |
-
[More Information Needed]
|
127 |
-
|
128 |
-
### Results
|
129 |
-
|
130 |
-
[More Information Needed]
|
131 |
-
|
132 |
-
#### Summary
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
## Model Examination [optional]
|
137 |
-
|
138 |
-
<!-- Relevant interpretability work for the model goes here -->
|
139 |
-
|
140 |
-
[More Information Needed]
|
141 |
-
|
142 |
-
## Environmental Impact
|
143 |
-
|
144 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
145 |
-
|
146 |
-
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).
|
147 |
-
|
148 |
-
- **Hardware Type:** [More Information Needed]
|
149 |
-
- **Hours used:** [More Information Needed]
|
150 |
-
- **Cloud Provider:** [More Information Needed]
|
151 |
-
- **Compute Region:** [More Information Needed]
|
152 |
-
- **Carbon Emitted:** [More Information Needed]
|
153 |
-
|
154 |
-
## Technical Specifications [optional]
|
155 |
-
|
156 |
-
### Model Architecture and Objective
|
157 |
-
|
158 |
-
[More Information Needed]
|
159 |
-
|
160 |
-
### Compute Infrastructure
|
161 |
-
|
162 |
-
[More Information Needed]
|
163 |
-
|
164 |
-
#### Hardware
|
165 |
-
|
166 |
-
[More Information Needed]
|
167 |
-
|
168 |
-
#### Software
|
169 |
-
|
170 |
-
[More Information Needed]
|
171 |
-
|
172 |
-
## Citation [optional]
|
173 |
-
|
174 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
175 |
-
|
176 |
-
**BibTeX:**
|
177 |
-
|
178 |
-
[More Information Needed]
|
179 |
-
|
180 |
-
**APA:**
|
181 |
-
|
182 |
-
[More Information Needed]
|
183 |
-
|
184 |
-
## Glossary [optional]
|
185 |
-
|
186 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
187 |
-
|
188 |
-
[More Information Needed]
|
189 |
-
|
190 |
-
## More Information [optional]
|
191 |
-
|
192 |
-
[More Information Needed]
|
193 |
-
|
194 |
-
## Model Card Authors [optional]
|
195 |
-
|
196 |
-
[More Information Needed]
|
197 |
-
|
198 |
-
## Model Card Contact
|
199 |
-
|
200 |
-
[More Information Needed]
|
201 |
-
|
202 |
|
|
|
4 |
- unsloth
|
5 |
---
|
6 |
|
7 |
+
# Requirements
|
8 |
|
9 |
<!-- Provide a quick summary of what the model is/does. -->
|
10 |
+
```python
|
11 |
+
|
12 |
+
%%capture
|
13 |
+
import torch
|
14 |
+
major_version, minor_version = torch.cuda.get_device_capability()
|
15 |
+
# Must install separately since Colab has torch 2.2.1, which breaks packages
|
16 |
+
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
17 |
+
if major_version >= 8:
|
18 |
+
# Use this for new GPUs like Ampere, Hopper GPUs (RTX 30xx, RTX 40xx, A100, H100, L40)
|
19 |
+
!pip install --no-deps packaging ninja einops flash-attn xformers trl peft accelerate bitsandbytes
|
20 |
+
else:
|
21 |
+
# Use this for older GPUs (V100, Tesla T4, RTX 20xx)
|
22 |
+
!pip install --no-deps xformers trl peft accelerate bitsandbytes
|
23 |
+
pass
|
24 |
+
!pip install gradio
|
25 |
+
|
26 |
+
```
|
27 |
+
|
28 |
+
|
29 |
+
## Inference
|
30 |
+
```python
|
31 |
+
|
32 |
+
max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
|
33 |
+
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
|
34 |
+
load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
|
35 |
+
import torch
|
36 |
+
from peft import AutoPeftModelForCausalLM
|
37 |
+
from transformers import AutoTokenizer
|
38 |
+
model_id="DisgustingOzil/MIstral_Pak_Law"
|
39 |
+
model = AutoPeftModelForCausalLM.from_pretrained(
|
40 |
+
model_id, # YOUR MODEL YOU USED FOR TRAINING
|
41 |
+
load_in_4bit = load_in_4bit,
|
42 |
+
torch_dtype = torch.float16,
|
43 |
+
|
44 |
+
)
|
45 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
46 |
+
# FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
47 |
+
alpaca_prompt = """Given the context and a specific question, generate a comprehensive and detailed response that accurately addresses the query.
|
48 |
+
|
49 |
+
### Context:
|
50 |
+
{}
|
51 |
+
|
52 |
+
### Question:
|
53 |
+
{}
|
54 |
+
|
55 |
+
### Answer:
|
56 |
+
{}"""
|
57 |
+
inputs = tokenizer(
|
58 |
+
[
|
59 |
+
alpaca_prompt.format(
|
60 |
+
"""1 Abandoned Properties (Taking over and Management) Act 1975 ACT XX OF 1975 ABANDONED PROPERTIES (TAKING OVER AND MANAGEMENT) ACT, 1975 An Act to provide for the taking over and management of certain properties [Gazette of Pakistan, Extraordinary, Part I, 17th February 1975] The following Act of Parliament received the assent of the President on the 12th February 1975, and is hereby published for general information :- Whereas it is expedient to provide for the taking over and management of certain properties, and for matters connected therewith ; And whereas the Proclamation of Emergency referred to in Article 280 of the Constitution is still in force; It is hereby enacted as follows:- ACT XX OF 1975 ABANDONED PROPERTIES (TAKING OVER AND MANAGEMENT) ACT, 1975 An Act to provide for the taking over and management of certain properties [Gazette of Pakistan, Extraordinary, Part I, 17th February 1975] The following Act of Parliament received the assent of the President on the 12th February 1975, and is hereby published for general information :- 1. Short title, extent and commencement.-(1) This Act may be called the Abandoned Properties (Taking Over and Management) Act, 1975. (2) It extends to the whole of Pakistan. (3) It""", # instruction
|
61 |
+
"""Could you please explain the process defined in the Abandoned Properties (Taking Over and Management) Act 1975 for determining if a property is considered abandoned?""", # input
|
62 |
+
"", # output - leave this blank for generation!
|
63 |
+
)
|
64 |
+
], return_tensors = "pt").to("cuda")
|
65 |
+
|
66 |
+
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
|
67 |
+
tokenizer.batch_decode(outputs)
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|