Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -1,60 +1,42 @@
|
|
1 |
---
|
2 |
-
library_name: peft
|
3 |
license: other
|
4 |
base_model: Qwen/Qwen2-VL-2B-Instruct
|
|
|
5 |
tags:
|
6 |
-
-
|
7 |
- lora
|
8 |
-
-
|
9 |
-
|
10 |
-
-
|
11 |
-
results: []
|
12 |
---
|
13 |
|
14 |
-
|
15 |
-
should probably proofread and complete it, then remove this comment. -->
|
16 |
|
17 |
-
|
18 |
|
19 |
-
This
|
20 |
|
21 |
-
##
|
22 |
|
23 |
-
|
|
|
|
|
|
|
24 |
|
25 |
-
|
|
|
26 |
|
27 |
-
|
|
|
|
|
28 |
|
29 |
-
|
|
|
|
|
|
|
30 |
|
31 |
-
|
32 |
|
33 |
-
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
The following hyperparameters were used during training:
|
38 |
-
- learning_rate: 2e-05
|
39 |
-
- train_batch_size: 1
|
40 |
-
- eval_batch_size: 8
|
41 |
-
- seed: 42
|
42 |
-
- gradient_accumulation_steps: 16
|
43 |
-
- total_train_batch_size: 16
|
44 |
-
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
45 |
-
- lr_scheduler_type: linear
|
46 |
-
- lr_scheduler_warmup_steps: 50
|
47 |
-
- training_steps: 500
|
48 |
-
- mixed_precision_training: Native AMP
|
49 |
-
|
50 |
-
### Training results
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
### Framework versions
|
55 |
-
|
56 |
-
- PEFT 0.15.2
|
57 |
-
- Transformers 4.55.0
|
58 |
-
- Pytorch 2.6.0+cu118
|
59 |
-
- Datasets 3.6.0
|
60 |
-
- Tokenizers 0.21.1
|
|
|
1 |
---
|
|
|
2 |
license: other
|
3 |
base_model: Qwen/Qwen2-VL-2B-Instruct
|
4 |
+
library_name: transformers
|
5 |
tags:
|
6 |
+
- qwen2-vl
|
7 |
- lora
|
8 |
+
- multimodal
|
9 |
+
- amazon-listing
|
10 |
+
- kaggle
|
|
|
11 |
---
|
12 |
|
13 |
+
# Qwen2-VL LoRA — Amazon Listing Generator
|
|
|
14 |
|
15 |
+
Lightweight LoRA adapter trained with **LLaMA-Factory** to turn a product image into an Amazon-style listing (title, bullets, description).
|
16 |
|
17 |
+
> **Note:** This repo ships the **adapter only**. Load it on top of `Qwen/Qwen2-VL-2B-Instruct`.
|
18 |
|
19 |
+
## Quickstart
|
20 |
|
21 |
+
```python
|
22 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
23 |
+
from peft import PeftModel
|
24 |
+
from PIL import Image
|
25 |
|
26 |
+
base = "Qwen/Qwen2-VL-2B-Instruct"
|
27 |
+
adapter = "soupstick/qwen2vl-amazon-ft-lora"
|
28 |
|
29 |
+
model = AutoModelForCausalLM.from_pretrained(base, trust_remote_code=True, device_map="auto")
|
30 |
+
model = PeftModel.from_pretrained(model, adapter)
|
31 |
+
tok = AutoTokenizer.from_pretrained(base, trust_remote_code=True)
|
32 |
|
33 |
+
img = Image.open("sample.png").convert("RGB")
|
34 |
+
resp, _ = model.chat(tok, query="<image>\nGenerate Amazon listing.", history=[], image=img)
|
35 |
+
print(resp)
|
36 |
+
Training
|
37 |
|
38 |
+
Framework: LLaMA-Factory (LoRA)
|
39 |
|
40 |
+
Task: Multimodal instruction-following for e-commerce listings
|
41 |
|
42 |
+
Data: community dataset (see the dataset card linked below)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|