suriya7 commited on
Commit
ba7bbbc
·
verified ·
1 Parent(s): a686831

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +40 -191
README.md CHANGED
@@ -18,197 +18,46 @@ widget:
18
  sentence but keep the order of the characters in each word the
19
  same.<end_of_turn>\n<start_of_turn>model
20
  ---
21
- # Model Card for Model ID
22
 
23
- <!-- Provide a quick summary of what the model is/does. -->
24
-
25
- This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
26
 
27
  ## Model Details
28
-
29
- ### Model Description
30
-
31
- <!-- Provide a longer summary of what this model is. -->
32
-
33
-
34
-
35
- - **Developed by:** [More Information Needed]
36
- - **Funded by [optional]:** [More Information Needed]
37
- - **Shared by [optional]:** [More Information Needed]
38
- - **Model type:** [More Information Needed]
39
- - **Language(s) (NLP):** [More Information Needed]
40
- - **License:** [More Information Needed]
41
- - **Finetuned from model [optional]:** [More Information Needed]
42
-
43
- ### Model Sources [optional]
44
-
45
- <!-- Provide the basic links for the model. -->
46
-
47
- - **Repository:** [More Information Needed]
48
- - **Paper [optional]:** [More Information Needed]
49
- - **Demo [optional]:** [More Information Needed]
50
-
51
- ## Uses
52
-
53
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
54
-
55
- ### Direct Use
56
-
57
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
58
-
59
- [More Information Needed]
60
-
61
- ### Downstream Use [optional]
62
-
63
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
64
-
65
- [More Information Needed]
66
-
67
- ### Out-of-Scope Use
68
-
69
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
70
-
71
- [More Information Needed]
72
-
73
- ## Bias, Risks, and Limitations
74
-
75
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
76
-
77
- [More Information Needed]
78
-
79
- ### Recommendations
80
-
81
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
82
-
83
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
84
-
85
- ## How to Get Started with the Model
86
-
87
- Use the code below to get started with the model.
88
-
89
- [More Information Needed]
90
-
91
- ## Training Details
92
-
93
- ### Training Data
94
-
95
- <!-- 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. -->
96
-
97
- [More Information Needed]
98
-
99
- ### Training Procedure
100
-
101
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
102
-
103
- #### Preprocessing [optional]
104
-
105
- [More Information Needed]
106
-
107
-
108
- #### Training Hyperparameters
109
-
110
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
111
-
112
- #### Speeds, Sizes, Times [optional]
113
-
114
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
115
-
116
- [More Information Needed]
117
-
118
- ## Evaluation
119
-
120
- <!-- This section describes the evaluation protocols and provides the results. -->
121
-
122
- ### Testing Data, Factors & Metrics
123
-
124
- #### Testing Data
125
-
126
- <!-- This should link to a Dataset Card if possible. -->
127
-
128
- [More Information Needed]
129
-
130
- #### Factors
131
-
132
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
133
-
134
- [More Information Needed]
135
-
136
- #### Metrics
137
-
138
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
139
-
140
- [More Information Needed]
141
-
142
- ### Results
143
-
144
- [More Information Needed]
145
-
146
- #### Summary
147
-
148
-
149
-
150
- ## Model Examination [optional]
151
-
152
- <!-- Relevant interpretability work for the model goes here -->
153
-
154
- [More Information Needed]
155
-
156
- ## Environmental Impact
157
-
158
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
159
-
160
- 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).
161
-
162
- - **Hardware Type:** [More Information Needed]
163
- - **Hours used:** [More Information Needed]
164
- - **Cloud Provider:** [More Information Needed]
165
- - **Compute Region:** [More Information Needed]
166
- - **Carbon Emitted:** [More Information Needed]
167
-
168
- ## Technical Specifications [optional]
169
-
170
- ### Model Architecture and Objective
171
-
172
- [More Information Needed]
173
-
174
- ### Compute Infrastructure
175
-
176
- [More Information Needed]
177
-
178
- #### Hardware
179
-
180
- [More Information Needed]
181
-
182
- #### Software
183
-
184
- [More Information Needed]
185
-
186
- ## Citation [optional]
187
-
188
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
189
-
190
- **BibTeX:**
191
-
192
- [More Information Needed]
193
-
194
- **APA:**
195
-
196
- [More Information Needed]
197
-
198
- ## Glossary [optional]
199
-
200
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
201
-
202
- [More Information Needed]
203
-
204
- ## More Information [optional]
205
-
206
- [More Information Needed]
207
-
208
- ## Model Card Authors [optional]
209
-
210
- [More Information Needed]
211
-
212
- ## Model Card Contact
213
-
214
- [More Information Needed]
 
18
  sentence but keep the order of the characters in each word the
19
  same.<end_of_turn>\n<start_of_turn>model
20
  ---
21
+ # Gemma-2B Fine-Tuned Python Model
22
 
23
+ ## Overview
24
+ Gemma-2B Fine-Tuned Python Model is a deep learning model based on the Gemma-2B architecture, fine-tuned specifically for Python programming tasks. This model is designed to understand Python code and assist developers by providing suggestions, completing code snippets, or offering corrections to improve code quality and efficiency.
 
25
 
26
  ## Model Details
27
+ - **Model Name**: Gemma-2B Fine-Tuned Python Model
28
+ - **Model Type**: Deep Learning Model
29
+ - **Base Model**: Gemma-2B
30
+ - **Language**: Python
31
+ - **Task**: Python Code Understanding and Assistance
32
+
33
+ ## Example Use Cases
34
+ - Code completion: Automatically completing code snippets based on partial inputs.
35
+ - Syntax correction: Identifying and suggesting corrections for syntax errors in Python code.
36
+ - Code quality improvement: Providing suggestions to enhance code readability, efficiency, and maintainability.
37
+ - Debugging assistance: Offering insights and suggestions to debug Python code by identifying potential errors or inefficiencies.
38
+
39
+ ## How to Use
40
+ 1. **Install Gemma Python Package**:
41
+ ```bash
42
+ pip install transformers
43
+ ```
44
+
45
+ ## Inference
46
+ ```python
47
+ query = input('enter a query:')
48
+ prompt_template = """
49
+ <start_of_turn>user based on given instruction create a solution\n\nhere are the instruction {query}
50
+ <end_of_turn>\n<start_of_turn>model
51
+ """
52
+ prompt = prompt_template
53
+ encodeds = tokenizer(prompt, return_tensors="pt", add_special_tokens=True)
54
+
55
+ model_inputs = encodeds.to('cuda')
56
+
57
+ # Increase max_new_tokens if needed
58
+ generated_ids = merged_model.generate(**model_inputs, max_new_tokens=1000, do_sample=False, pad_token_id=tokenizer.eos_token_id)
59
+ output = ''
60
+ for i in tokenizer.decode(generated_ids[0], skip_special_tokens=True).split('<end_of_turn>')[:2]:# extracting mmodel response
61
+ ans+=i
62
+ cleaned_output = output.replace('<start_of_turn>', '')
63
+ print(cleaned_output)