ArcanaBT commited on
Commit
576df3e
·
verified ·
1 Parent(s): 7e63a1d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +100 -159
README.md CHANGED
@@ -1,199 +1,140 @@
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: peft
3
+ license: llama2
4
+ base_model: meta-llama/Llama-2-7b-hf
5
+ tags:
6
+ - generated_from_trainer
7
+ model-index:
8
+ - name: vetgpt-2-7b
9
+ results: []
10
  ---
11
+ # vetgpt-2-7b: A Veterinary Medicine Fine-Tuned Language Model
12
 
13
+ `vetgpt-2-7b` is a specialized conversational AI model derived from Meta AI's `meta-llama/Llama-2-7b-hf`, meticulously fine-tuned using the Low-Rank Adaptation (LoRA) technique to cater to the unique needs of veterinary medicine. Built upon the robust foundation of the Llama-2 family, this model has been tailored to assist veterinarians, animal health professionals, researchers, and enthusiasts by providing domain-specific insights into animal care, diagnostics, treatment recommendations, and veterinary education. With its 7 billion parameters, `vetgpt-2-7b` leverages the power of advanced natural language processing to deliver precise, context-aware responses in the field of veterinary science.
14
 
15
+ Developed with a focus on practical utility, this model aims to bridge the gap between cutting-edge AI technology and real-world veterinary applications. Whether you're a practicing veterinarian seeking quick guidance on a complex case or a student studying animal pathology, `vetgpt-2-7b` offers a reliable and knowledgeable assistant tailored to your needs.
16
 
17
+ ---
18
 
19
+ ## Model Overview
20
 
21
+ ### Base Model
22
+ `vetgpt-2-7b` is built upon `meta-llama/Llama-2-7b-hf`, a highly efficient and performant member of the Llama-2 family developed by Meta AI. The original Llama-2 models were designed for research and commercial use, excelling in natural language understanding and generation across a wide range of tasks. The `-hf` variant, optimized for compatibility with the Hugging Face ecosystem, serves as the backbone for this fine-tuned adaptation.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
+ ### Fine-Tuning Methodology
25
+ To adapt the model for veterinary medicine, we employed LoRA, a parameter-efficient fine-tuning approach that modifies only a small subset of the model's weights. This technique allowed us to retain the general-purpose capabilities of the base model while injecting specialized knowledge from the veterinary domain. The LoRA configuration includes:
26
+ - **Rank (r)**: 8
27
+ - **LoRA Alpha**: 16
28
+ - **Dropout**: 0.1
29
+ - **Target Modules**: `q_proj`, `v_proj`
30
 
31
+ This setup ensures computational efficiency while achieving significant improvements in domain-specific performance.
32
 
33
  ### Training Data
34
+ The fine-tuning process utilized a custom dataset, `dataset_cleaned_ALL_1700.jsonl`, comprising approximately 1700 carefully curated examples. This dataset includes:
35
+ - **Instructions**: Veterinary-related prompts and queries (e.g., "How to treat a dog's persistent cough?").
36
+ - **Inputs**: Contextual information or case descriptions provided by veterinary professionals.
37
+ - **Outputs**: Detailed, accurate responses grounded in veterinary science.
38
 
39
+ The data was sourced from a variety of veterinary resources, including clinical case studies, treatment protocols, and educational materials, ensuring a comprehensive representation of the field. While the dataset is primarily in Turkish and English, the model's multilingual capabilities allow it to handle queries in both languages effectively.
 
 
 
 
 
 
 
 
40
 
41
+ ### Training Environment
42
+ The model was trained on Google Colab using an NVIDIA A100 GPU, a state-of-the-art accelerator with 40 GB of HBM3 memory. To optimize memory usage and training speed, we applied 8-bit quantization via `BitsAndBytesConfig` and leveraged bfloat16 precision, both fully supported by the A100's hardware. The training process spanned 3 epochs, balancing performance gains with computational efficiency.
43
 
44
+ ---
45
 
46
+ ## Technical Specifications
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
+ - **Parameter Count**: 7 billion
49
+ - **Architecture**: Auto-regressive transformer with grouped-query attention (GQA), as inherited from Llama-2.
50
+ - **Context Length**: 256 tokens (configurable up to 512 or more with A100's memory capacity).
51
+ - **Quantization**: 8-bit integer weights for memory efficiency.
52
+ - **Precision**: bfloat16 for mixed-precision training and inference.
53
+ - **Vocabulary Size**: 32,000 tokens, consistent with the Llama-2 tokenizer.
54
+ - **Training Duration**: Approximately [insert duration after training, e.g., "6 hours"] on an A100 GPU.
55
 
56
+ The model retains the efficiency and scalability of the original Llama-2 design while incorporating veterinary-specific adaptations, making it both powerful and practical for real-world use.
57
 
58
+ ---
59
 
60
+ ## Purpose and Capabilities
61
 
62
+ `vetgpt-2-7b` was developed to serve as a dedicated assistant for the veterinary community. Unlike general-purpose language models, it excels in understanding and generating responses tailored to animal health and welfare. Its key capabilities include:
63
+ - **Diagnostic Support**: Assisting with symptom analysis and suggesting potential diagnoses based on veterinary knowledge.
64
+ - **Treatment Recommendations**: Providing guidance on medications, dosages, and care protocols for various animal species.
65
+ - **Educational Tool**: Supporting veterinary students and professionals with explanations of complex concepts, case studies, and best practices.
66
+ - **Multilingual Interaction**: Handling queries in Turkish and English, with potential for expansion to other languages depending on the dataset.
67
 
68
+ While the base `Llama-2-7b-chat-hf` model was optimized for conversational tasks with an emphasis on safety and helpfulness, `vetgpt-2-7b` shifts this focus toward veterinary precision and utility, making it an invaluable resource for professionals working with animals.
69
 
70
+ ---
71
 
72
+ ## Performance
73
 
74
+ The original Llama-2-7b-chat model was pre-trained on 2 trillion tokens from publicly available internet texts and fine-tuned with over 1 million human-annotated examples using Supervised Fine-Tuning (SFT) and Reinforcement Learning with Human Feedback (RLHF). It outperformed many open-source chat models and approached the capabilities of proprietary systems like ChatGPT in general conversational benchmarks.
75
 
76
+ `vetgpt-2-7b` builds on this foundation but shifts the performance focus to veterinary medicine. While it retains strong general language skills, its fine-tuning on a targeted dataset ensures superior accuracy and relevance in veterinary contexts. Preliminary evaluations (based on the training data) suggest that it surpasses the base model in tasks such as:
77
+ - Answering domain-specific questions (e.g., "What antibiotics are safe for cats with kidney issues?").
78
+ - Generating coherent and detailed veterinary care instructions.
79
 
80
+ Formal benchmarks are pending, but users are encouraged to test the model with their own veterinary datasets and share results to further refine its capabilities.
81
 
82
+ ## Requirements
83
+ transformers>=4.35.0
84
+ torch>=2.0.0
85
+ bitsandbytes (for 8-bit quantization)
86
+ GPU with CUDA support recommended (e.g., NVIDIA A100, T4, or higher).
87
+ License
88
+ vetgpt-2-7b is derived from meta-llama/Llama-2-7b-hf and is therefore subject to the Meta AI Llama 2 License. Users must review and accept this license before downloading or deploying the model. The license permits both research and commercial use under specific conditions, but redistribution of the base model weights is restricted. The fine-tuned LoRA adapters are shared under the same terms, with no additional restrictions unless specified by the veterinary dataset's ownership rights (if applicable).
89
 
90
+ ## Limitations and Disclaimer
91
+ While vetgpt-2-7b is a powerful tool for veterinary applications, it is not without limitations:
92
 
93
+ Domain Specificity: Its performance is optimized for veterinary medicine and may not match general-purpose models in unrelated tasks.
94
+ Data Dependency: The model's knowledge is limited to the dataset_cleaned_ALL_1700.jsonl dataset and the pre-training of Llama-2. It may not cover rare or emerging veterinary conditions absent from this data.
95
+ No Real-Time Updates: As a static model, it cannot access real-time veterinary research or updates post-training (March 24, 2025 cutoff assumed).
96
+ Disclaimer: This model is intended as an assistive tool for veterinary professionals and should not replace qualified veterinarians. Outputs are provided "AS IS" and should not be solely relied upon for critical medical decisions involving animal health. Always consult a licensed veterinarian for diagnosis and treatment.
97
 
98
+ ## Acknowledgments
99
+ This project builds upon the groundbreaking work of Meta AI's Llama-2 team, whose efforts in developing efficient and performant language models have enabled domain-specific adaptations like vetgpt-2-7b. We also acknowledge the Hugging Face community for providing the tools and infrastructure to fine-tune and share this model seamlessly.
100
 
101
+ ## Contact and Contributions
102
+ For feedback, questions, or contributions, please reach out via the Hugging Face repository discussion tab at melihyuksel01/vetgpt-2-7b. We welcome suggestions for improving the model, expanding the dataset, or adding new veterinary use cases. If you have additional veterinary data or benchmarks to share, feel free to contribute to make vetgpt-2-7b an even more valuable resource for the global veterinary community.
103
 
104
+ ## Future Directions
105
+ We envision vetgpt-2-7b as the foundation for a series of veterinary AI tools. Potential future enhancements include:
106
 
107
+ Expanding the dataset with more diverse veterinary cases and languages.
108
+ Integrating multimodal capabilities (e.g., analyzing veterinary images or lab reports).
109
+ Fine-tuning with RLHF to improve response helpfulness and safety in veterinary contexts.
110
+ Stay tuned for updates as we continue to refine and grow this model!
111
 
112
+ ### Training hyperparameters
113
 
114
+ The following hyperparameters were used during training:
115
+ - learning_rate: 0.0002
116
+ - train_batch_size: 32
117
+ - eval_batch_size: 8
118
+ - seed: 42
119
+ - gradient_accumulation_steps: 2
120
+ - total_train_batch_size: 64
121
+ - optimizer: Use OptimizerNames.ADAMW_8BIT with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
122
+ - lr_scheduler_type: linear
123
+ - num_epochs: 3
124
 
125
+ ### Training results
126
 
127
+ | Training Loss | Epoch | Step | Validation Loss |
128
+ |:-------------:|:------:|:----:|:---------------:|
129
+ | 0.4817 | 1.0 | 108 | 0.5623 |
130
+ | 0.4648 | 2.0 | 216 | 0.5531 |
131
+ | 0.4478 | 2.9767 | 321 | 0.5512 |
132
 
 
133
 
134
+ ### Framework versions
135
 
136
+ - PEFT 0.14.0
137
+ - Transformers 4.49.0
138
+ - Pytorch 2.6.0+cu124
139
+ - Datasets 3.4.1
140
+ - Tokenizers 0.21.1