Update README.md
Browse files
README.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
|
|
|
|
|
|
|
|
|
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
|
@@ -71,7 +75,55 @@ Users (both direct and downstream) should be made aware of the risks, biases and
|
|
71 |
|
72 |
Use the code below to get started with the model.
|
73 |
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
## Training Details
|
77 |
|
@@ -79,12 +131,18 @@ Use the code below to get started with the model.
|
|
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 |
-
|
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]
|
@@ -126,7 +184,7 @@ Use the code below to get started with the model.
|
|
126 |
|
127 |
### Results
|
128 |
|
129 |
-
|
130 |
|
131 |
#### Summary
|
132 |
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
datasets:
|
4 |
+
- Joctor/cn_bokete_oogiri_caption
|
5 |
+
base_model:
|
6 |
+
- Qwen/Qwen2-VL-7B-Instruct
|
7 |
+
pipeline_tag: image-to-text
|
8 |
---
|
9 |
|
10 |
# Model Card for Model ID
|
11 |
|
12 |
<!-- Provide a quick summary of what the model is/does. -->
|
13 |
+
AI大喜利
|
14 |
|
15 |
|
16 |
## Model Details
|
|
|
75 |
|
76 |
Use the code below to get started with the model.
|
77 |
|
78 |
+
from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
|
79 |
+
from qwen_vl_utils import process_vision_info
|
80 |
+
|
81 |
+
model_id = "Joctor/qwen2-vl-7b-instruct-ogiri"
|
82 |
+
|
83 |
+
# default: Load the model on the available device(s)
|
84 |
+
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
85 |
+
model_id, torch_dtype="auto", device_map="auto"
|
86 |
+
)
|
87 |
+
|
88 |
+
# default processer
|
89 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
90 |
+
|
91 |
+
messages = [
|
92 |
+
{
|
93 |
+
"role": "user",
|
94 |
+
"content": [
|
95 |
+
{
|
96 |
+
"type": "image",
|
97 |
+
"image": "path/to/image",
|
98 |
+
},
|
99 |
+
{"type": "text", "text": "根据图片给出有趣巧妙的回答"},
|
100 |
+
],
|
101 |
+
}
|
102 |
+
]
|
103 |
+
|
104 |
+
# Preparation for inference
|
105 |
+
text = processor.apply_chat_template(
|
106 |
+
messages, tokenize=False, add_generation_prompt=True
|
107 |
+
)
|
108 |
+
image_inputs, video_inputs = process_vision_info(messages)
|
109 |
+
inputs = processor(
|
110 |
+
text=[text],
|
111 |
+
images=image_inputs,
|
112 |
+
videos=video_inputs,
|
113 |
+
padding=True,
|
114 |
+
return_tensors="pt",
|
115 |
+
)
|
116 |
+
inputs = inputs.to("cuda")
|
117 |
+
|
118 |
+
# Inference: Generation of the output
|
119 |
+
generated_ids = model.generate(**inputs, max_new_tokens=128)
|
120 |
+
generated_ids_trimmed = [
|
121 |
+
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
|
122 |
+
]
|
123 |
+
output_text = processor.batch_decode(
|
124 |
+
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
|
125 |
+
)
|
126 |
+
print(output_text)
|
127 |
|
128 |
## Training Details
|
129 |
|
|
|
131 |
|
132 |
<!-- 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. -->
|
133 |
|
134 |
+
https://huggingface.co/datasets/Joctor/cn_bokete_oogiri_caption
|
135 |
|
136 |
### Training Procedure
|
137 |
|
138 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
139 |
|
140 |
+
基础模型:qwen2vl
|
141 |
+
微调方式:数据量充足,采用SFT微调
|
142 |
+
微调参数:max_length=1024(短就是好!), num_train_epochs=1, per_device_train_batch_size=1, gradient_accumulation_steps=1
|
143 |
+
训练设备:10 * 4090D
|
144 |
+
训练时长:22小时
|
145 |
+
|
146 |
#### Preprocessing [optional]
|
147 |
|
148 |
[More Information Needed]
|
|
|
184 |
|
185 |
### Results
|
186 |
|
187 |
+
https://www.gcores.com/articles/188405
|
188 |
|
189 |
#### Summary
|
190 |
|