File size: 6,495 Bytes
424227a
 
 
 
 
 
 
 
 
 
e08d832
e8c2d10
e08d832
42f8dac
033a456
 
 
 
 
42f8dac
033a456
424227a
 
 
e08d832
 
42f8dac
033a456
e08d832
033a456
e08d832
033a456
 
 
 
 
e08d832
033a456
e08d832
033a456
e08d832
033a456
 
 
e08d832
033a456
 
 
e08d832
033a456
 
 
e08d832
033a456
 
 
9bf69a1
033a456
e08d832
3844d8b
42f8dac
9bf69a1
 
 
42f8dac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e08d832
033a456
e08d832
033a456
e08d832
033a456
aadd6e8
033a456
 
 
 
 
e08d832
033a456
 
 
e08d832
033a456
 
 
fdd84f8
 
 
 
033a456
 
e08d832
033a456
 
 
e08d832
033a456
e08d832
033a456
e08d832
033a456
e08d832
033a456
 
 
42f8dac
033a456
 
 
 
 
e08d832
 
033a456
e08d832
033a456
 
 
e08d832
 
 
 
 
 
276d6cf
e08d832
 
 
033a456
e08d832
033a456
e08d832
 
 
033a456
e08d832
033a456
e08d832
033a456
e08d832
033a456
1837920
033a456
 
 
42f8dac
1
2
3
4
5
6
7
8
9
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
library_name: transformers
tags:
- vaccination
- immunization
- chatbot
- healthcare
language:
- en
---

# Model Card for HelpMum Vax-Llama-1

The HelpMum Vax-Llama-1 is an advanced language model designed to provide accurate and relevant information about vaccinations and immunizations. It is fine-tuned from the Llama 3.1 8B model and built using the Hugging Face Transformers framework. This model has 8 billion parameters and is optimized for delivering precise responses to queries related to vaccination safety, schedules, and more.

## Model Details

### Model Description

The HelpMum Vax-Llama-1 model is a specialized chatbot model developed to enhance the dissemination of vaccination-related information. It has been fine-tuned from the Llama 3.1 8B base model, using a diverse dataset of vaccination queries and responses. This model aims to provide reliable information to users, helping them make informed decisions about vaccinations.

- **Developed by:** HelpMum
- **Funded by:** HelpMum
- **Shared by:** HelpMum
- **Model type:** Transformer-based language model
- **Language(s) (NLP):** English
- **Finetuned from model:** Llama 3.1 8B

### Model Sources

- **Repository:** [HelpMumHQ/vax-llama-1](https://huggingface.co/HelpMumHQ/vax-llama-1)

## Uses

### Direct Use

The model can be directly used to answer queries related to vaccinations and immunizations without any further fine-tuning. It is suitable for integration into chatbots and other automated response systems in healthcare settings.

### Downstream Use

The model can be fine-tuned for specific tasks or integrated into larger ecosystems and applications that require accurate vaccination information dissemination.

### Out-of-Scope Use

The model is not intended for use in generating medical advice beyond vaccination information. It should not be used for diagnosing medical conditions or providing treatment recommendations.

## Bias, Risks, and Limitations

The model is trained on a dataset of vaccination-related information, which may not cover all possible queries or scenarios. Users should be aware of potential biases in the data and limitations in the model's knowledge. It is essential to consult healthcare professionals for personalized medical advice.

### Recommendations

Users should ensure that the model is used in contexts where it can provide valuable information while being aware of its limitations. For critical medical decisions, consultation with healthcare professionals is recommended.

## How to Get Started with the Model

Use the code below to get started with the model (make sure you have access to the model). 

```python
!pip install -q -U transformers bitsandbytes

from huggingface_hub import HfFolder
HfFolder.save_token('hf_...')  

from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained('HelpMumHQ/vax-llama-1')
model = AutoModelForCausalLM.from_pretrained('HelpMumHQ/vax-llama-1')

def generate_response(user_message):
    tokenizer.chat_template = "{%- for message in messages %}{{ bos_token + '[INST] ' + message['content'] + ' [/INST]' if message['role'] == 'user' else ' ' + message['content'] + ' ' + eos_token }}{%- endfor %}"
    messages = [{"role": "user", "content": user_message}]
    prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    inputs = tokenizer(prompt, return_tensors='pt', truncation=True).to("cuda")
    outputs = model.generate(**inputs, max_length=150, num_return_sequences=1)
    text = tokenizer.decode(outputs[0], skip_special_tokens=True)
    response = (text[text.find('[/INST]') + len('[/INST]'):text.find('[INST]', text.find('[/INST]') + len('[/INST]'))] if text.find('[INST]', text.find('[/INST]') + len('[/INST]')) != -1 else text[text.find('[/INST]') + len('[/INST]'):]).strip().split('[/INST]')[0].strip()
    return response

# Sample usage
user_message = "Are vaccines safe for pregnant women?"
response = generate_response(user_message)
print(response)
```

## Training Details

### Training Data

The data for this model was collected from HelpMum's extensive database of vaccination-related queries and responses, which includes real-world interactions and expert-verified information.

### Testing Data, Factors & Metrics

#### Testing Data

The testing data was a separate subset of vaccination-related queries to evaluate the model's performance accurately.

#### Factors

The evaluation considered various factors, including the accuracy and relevance of responses, latency, and token allowance.

#### Metrics

- **Loss:** 0.3554
- **Runtime:** 195.8647 seconds
- **Samples per Second:** 0.735

### Results

The Vax-Llama-1 model performed well in delivering accurate and relevant responses to vaccination queries, with high user satisfaction and efficiency.

#### Summary

The model demonstrated robust performance across various evaluation metrics, making it a reliable tool for vaccination information dissemination.

## Model Examination

The model underwent rigorous testing and evaluation to ensure it meets the desired performance standards for accuracy and relevance.

## Technical Specifications

### Model Architecture and Objective

The Vax-Llama-1 is a transformer-based language model built on the Llama 3.1 architecture, designed to generate accurate responses to vaccination-related queries.

### Compute Infrastructure

#### Software

- **Framework:** Transformers (Hugging Face)
- **Programming Language:** Python

## Citation

**BibTeX:**

```bibtex
@misc {helpmumhq_2024,
    author       = { {HelpMumHQ} },
    title        = { vax-llama-1 (Revision 033a456) },
    year         = 2024,
    url          = { https://huggingface.co/HelpMumHQ/vax-llama-1 },
    doi          = { 10.57967/hf/2793 },
    publisher    = { Hugging Face }
}
```

## Glossary

- **Transformer:** A type of neural network architecture used for natural language processing tasks.
- **Fine-Tuning:** The process of taking a pre-trained model and further training it on a specific task or dataset.
- **Tokenization:** The process of converting text into a format that can be used by the model, typically involving splitting text into tokens.

## More Information

For more details and access to the model, visit [HelpMumHQ/vax-llama-1](https://huggingface.co/HelpMumHQ/vax-llama-1).

## Model Card Authors

HelpMum Tech Team

## Model Card Contact

For questions or feedback, please contact [HelpMum](mailto:[email protected]).