File size: 4,270 Bytes
f495d13
 
 
7b90295
 
 
 
f495d13
 
b51955d
f495d13
b51955d
f495d13
 
 
 
 
 
 
7b90295
f495d13
 
7b90295
f495d13
 
 
7b90295
f495d13
7b90295
f495d13
7b90295
f495d13
 
 
 
7b90295
f495d13
 
 
 
7b90295
f495d13
 
 
 
7b90295
f495d13
 
 
 
 
 
 
 
 
 
 
 
7b90295
f495d13
 
 
7b90295
f495d13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bd08319
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
library_name: peft
base_model: HuggingFaceM4/idefics-9b
datasets:
- TheFusion21/PokemonCards
language:
- en
---

# Model Card for ckandemir/idefics-9b-pokemon-peft Model

This model card provides an overview of a fine-tuned version of the idefics-9b model, specialized in understanding and generating content related to Pokémon cards.



## Model Details

### Model Description

The model is a fine-tuned derivative of the large-scale [`HuggingFaceM4/idefics-9b`](https://huggingface.co/HuggingFaceM4/idefics-9b-instruct), leveraging the PEFT. It is specialized in tasks related to Pokémon card data, capable of various NLP tasks like text generation, classification, and analysis within the context of Pokémon trading cards.


- **Finetuned from model [optional]:** [HuggingFaceM4/idefics-9b](https://huggingface.co/HuggingFaceM4/idefics-9b-instruct)

### Direct Use

The model is designed for direct use in applications involving Pokémon card data analysis, generation, and enrichment tasks.

### Downstream Use 

Further fine-tuning on other niche domains could enable the model to perform specialized tasks in additional contexts beyond Pokémon cards.


### Out-of-Scope Use

The model may not perform well on general NLP tasks unrelated to Pokémon data or vastly different domains without further fine-tuning.


## Bias, Risks, and Limitations

The model may inherit biases present in the Pokémon card dataset and may not generalize well to other contexts. Use in sensitive areas should be with caution.


### Recommendations

Users should be aware of the model's specialized nature and its limitations when applied outside its intended domain.
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.

## How to Get Started with the Model

Use the code below to get started with the model.

[More Information Needed]

## Training Details

### Training Data

The model was trained on the `TheFusion21/PokemonCards` dataset from HuggingFace. Initially, the dataset underwent a cleaning process to remove any invalid URLs that could disrupt the training pipeline. Subsequently, the data was preprocessed to align with the model's input requirements, ensuring efficient and error-free training.

### Training Procedure 

The dataset was preprocessed to fit the model's input requirements, with special attention to tokenization and formatting.
#### Preprocessing [optional]

[More Information Needed]


#### Training Hyperparameters

- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->

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

<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->



## Training procedure


The following `bitsandbytes` quantization config was used during training:
- quant_method: bitsandbytes
- load_in_8bit: False
- load_in_4bit: True
- llm_int8_threshold: 6.0
- llm_int8_skip_modules: ['lm_head', 'embed_tokens']
- llm_int8_enable_fp32_cpu_offload: False
- llm_int8_has_fp16_weight: False
- bnb_4bit_quant_type: nf4
- bnb_4bit_use_double_quant: True
- bnb_4bit_compute_dtype: float16

### Framework versions


- PEFT 0.6.2.dev0

### Code

```python
from peft import PeftModel, PeftConfig

peft_model_id='ckandemir/idefics-9b-pokemon-peft'
quantization_config = BitsAndBytesConfig(
                                load_in_4bit=True,
                                bnb_4bit_use_double_quant=True,
                                bnb_4bit_quant_type="nf4",
                                bnb_4bit_compute_dtype=torch.float16,
                                llm_int8_skip_modules=["lm_head", "embed_tokens"],
                            )
config = PeftConfig.from_pretrained(peft_model_id)
# Load the model with the appropriate configuration for inference
model = IdeficsForVisionText2Text.from_pretrained(config.base_model_name_or_path, quantization_config=quantization_config, device_map="auto")
processor = AutoProcessor.from_pretrained(config.base_model_name_or_path)

model = PeftModel.from_pretrained(model, peft_model_id, device_map={"":0})

```