File size: 6,130 Bytes
5238e60
 
 
 
 
bc3f3f1
5238e60
 
 
 
 
bc3f3f1
5238e60
bc3f3f1
 
 
 
 
 
 
5238e60
bc3f3f1
5238e60
bc3f3f1
 
 
5238e60
 
 
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
 
 
bc3f3f1
5238e60
 
 
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
 
 
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
 
 
bc3f3f1
 
 
 
 
5238e60
 
 
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
 
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
5238e60
 
 
bc3f3f1
 
 
5238e60
5659163
bc3f3f1
5659163
bc3f3f1
5659163
 
 
 
 
 
 
 
 
 
 
 
 
bc3f3f1
 
 
 
 
5659163
 
 
 
bc3f3f1
 
 
 
 
 
 
 
 
 
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
base_model: mistralai/Mistral-7B-Instruct-v0.3
library_name: peft
---

# Model Card for MistralF

## Model Details

### Model Description

This model is an adapter fine-tuned on top of `mistralai/Mistral-7B-Instruct-v0.3`, a 7-billion-parameter instruction-following language model developed by Mistral AI. The adapter was fine-tuned using the PEFT (Parameter-Efficient Fine-Tuning) library to adapt the base model for a specific task while keeping the original weights frozen. The fine-tuning task and dataset details are not specified, but this adapter can be used for natural language generation tasks such as text completion, instruction following, or dialogue generation.

- **Developed by:** Danna8
- **Funded by [optional]:** Not applicable
- **Shared by [optional]:** Danna8
- **Model type:** Adapter for a Causal Language Model (Mistral-7B-Instruct-v0.3)
- **Language(s) (NLP):** English (assumed; adjust if different)
- **License:** Apache 2.0 (same as the base model; adjust if you prefer a different license for the adapter)
- **Finetuned from model [optional]:** mistralai/Mistral-7B-Instruct-v0.3

### Model Sources

- **Repository:** https://huggingface.co/Danna8/MistralF
- **Paper [optional]:** Not applicable
- **Demo [optional]:** Not available

## Uses

### Direct Use

This model can be used for natural language generation tasks, such as generating responses to instructions, completing text, or engaging in dialogue. It is intended for users who want to leverage the capabilities of `mistralai/Mistral-7B-Instruct-v0.3` with additional fine-tuning for a specific use case.

### Downstream Use [optional]

The model can be further fine-tuned or integrated into larger applications, such as chatbots, virtual assistants, or content generation tools.

### Out-of-Scope Use

This model should not be used for generating harmful, biased, or misleading content. It may not perform well on tasks outside its fine-tuning domain or on languages other than English (if fine-tuned on English data).

## Bias, Risks, and Limitations

As a fine-tuned version of `mistralai/Mistral-7B-Instruct-v0.3`, this model inherits the biases and limitations of the base model, including potential biases in the training data (e.g., Wikipedia, web crawls). The fine-tuning process may introduce additional biases depending on the dataset used. The model may generate incorrect or inappropriate responses, especially if the fine-tuning task was narrow or the input is out of scope.

### Recommendations

Users should evaluate the model’s outputs for accuracy and appropriateness, especially in sensitive applications. Consider implementing post-processing or filtering to mitigate risks of harmful or biased content.

## How to Get Started with the Model

See the usage section below for a code example to load and use the model.

## Training Details

### Training Data

The specific dataset used for fine-tuning is not specified. Users are encouraged to contact the model developer (Danna8) for more details about the fine-tuning data.

### Training Procedure

#### Preprocessing [optional]

Not specified. Assumed to follow the standard preprocessing for `mistralai/Mistral-7B-Instruct-v0.3`, including tokenization with the provided tokenizer files.

#### Training Hyperparameters

- **Training regime:** fp16 mixed precision (assumed; adjust if different)

#### Speeds, Sizes, Times [optional]

Not specified.

## Evaluation

### Testing Data, Factors & Metrics

#### Testing Data

Not specified.

#### Factors

Not specified.

#### Metrics

Not specified.

### Results

Not specified.

## Model Examination [optional]

Not specified.

## Environmental Impact

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).

- **Hardware Type:** Not specified (e.g., NVIDIA A100 GPU; adjust if known)
- **Hours used:** Not specified
- **Cloud Provider:** Not specified
- **Compute Region:** Not specified
- **Carbon Emitted:** Not specified

## Technical Specifications [optional]

### Model Architecture and Objective

The base model (`mistralai/Mistral-7B-Instruct-v0.3`) is a transformer-based causal language model with 7 billion parameters, optimized for instruction-following tasks. The adapter adds a small set of trainable parameters to adapt the model for a specific task, using the PEFT library.

### Compute Infrastructure

Not specified.

#### Hardware

Not specified.

#### Software

- Transformers library (Hugging Face)
- PEFT 0.14.0

## Citation [optional]

Not applicable.

## Glossary [optional]

- **PEFT**: Parameter-Efficient Fine-Tuning, a method to fine-tune large language models by training only a small set of additional parameters (adapters) while keeping the base model frozen.

## More Information [optional]

Contact the model developer (Danna8) for more details.

## Model Card Authors [optional]

Danna8

## Model Card Contact

Contact Danna8 via the Hugging Face Hub.

### Framework Versions

- PEFT 0.14.0
- Transformers (version not specified; recommended to use the latest version)

## Usage

This adapter is fine-tuned on top of `mistralai/Mistral-7B-Instruct-v0.3`. To use it:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model_name = "mistralai/Mistral-7B-Instruct-v0.3"
adapter_model_name = "Danna8/MistralF"

# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained(adapter_model_name)

# Load the base model and apply the adapter
model = AutoModelForCausalLM.from_pretrained(
    base_model_name,
    torch_dtype=torch.float16,  # Use FP16 for efficiency
    device_map="auto"  # Automatically map to GPU if available
)
model.load_adapter(adapter_model_name)
model.set_active_adapters("default")  # Adjust the adapter name if needed

# Example inference
inputs = tokenizer("Hello, how are you?", return_tensors="pt").to("cuda")
outputs = model.generate(
    **inputs,
    max_new_tokens=50,
    do_sample=True,
    top_p=0.95,
    temperature=0.7
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))