PEFT
Safetensors
qtnx commited on
Commit
92cd936
1 Parent(s): e4942ba

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +63 -3
  2. adapter_config.json +36 -0
  3. adapter_model.safetensors +3 -0
README.md CHANGED
@@ -1,3 +1,63 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: qresearch/doubutsu-2b-pt-756
3
+ library_name: peft
4
+ ---
5
+
6
+ # doubutsu-2b-lora-756-vqa
7
+
8
+ An adapter for [qresearch/doubutsu-2b-pt-756](https://huggingface.co/qresearch/doubutsu-2b-pt-756) on [vqa_small](https://huggingface.co/datasets/abhishek/vqa_small) for 3 epochs.
9
+
10
+ ## Usage
11
+
12
+ ```python
13
+ import torch
14
+ from transformers import AutoModelForCausalLM, AutoTokenizer
15
+ from PIL import Image
16
+
17
+ model_id = "qresearch/doubutsu-2b-pt-756"
18
+ model = AutoModelForCausalLM.from_pretrained(
19
+ model_id,
20
+ trust_remote_code=True,
21
+ torch_dtype=torch.float16,
22
+ ).to("cuda")
23
+
24
+ tokenizer = AutoTokenizer.from_pretrained(
25
+ model_id,
26
+ use_fast=True,
27
+ )
28
+
29
+ model.load_adapter("qresearch/doubutsu-2b-lora-756-vqa")
30
+
31
+ image = Image.open("IMAGE")
32
+
33
+ print(
34
+ model.answer_question(
35
+ image, "Describe the image", tokenizer, max_new_tokens=128, temperature=0.1
36
+ ),
37
+ )
38
+ ```
39
+
40
+ ## Examples
41
+
42
+ | Image | Examples |
43
+ | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
44
+ | <img src="assets/demo1.png" width="300"/> | **Describe the image.**<br>A top-down view of a sidewalk with the word "ROW" in orange spray paint on the left side. A red fire lane symbol is below the word in the middle. A line is on the right side of the sidewalk, going up vertically. A metal strip is on the left side of the sidewalk, going horizontally. Dirt is on the ground in front of the sidewalk. |
45
+ | <img src="assets/demo2.png" width="300"/> | **Describe the image.**<br>A low-angle view of a golden statue of a woman on top of a golden horse and a golden chariot. The woman is facing the right side of the image. She is holding a golden bird in her right hand and a golden shield in her left hand. She is wearing a golden robe with a golden belt around her waist. She is wearing a golden helmet on her head. She is holding a golden staff in her right hand and her left hand is raised up above her head, palm facing forward. The woman is wearing a golden crown on her head. The horse is facing the left side of the image. |
46
+
47
+ ```
48
+ .x+=:.
49
+ z` ^% .uef^"
50
+ .u . . <k .u . :d88E
51
+ .u@u .d88B :@8c .u .@8Ned8" .u u .d88B :@8c . `888E
52
+ .zWF8888bx ="8888f8888r ud8888. .@^%8888" ud8888. us888u. ="8888f8888r .udR88N 888E .z8k
53
+ .888 9888 4888>'88" :888'8888. x88: `)8b. :888'8888. .@88 "8888" 4888>'88" <888'888k 888E~?888L
54
+ I888 9888 4888> ' d888 '88%" 8888N=*8888 d888 '88%" 9888 9888 4888> ' 9888 'Y" 888E 888E
55
+ I888 9888 4888> 8888.+" %8" R88 8888.+" 9888 9888 4888> 9888 888E 888E
56
+ I888 9888 .d888L .+ 8888L @8Wou 9% 8888L 9888 9888 .d888L .+ 9888 888E 888E
57
+ `888Nx?888 ^"8888*" '8888c. .+ .888888P` '8888c. .+ 9888 9888 ^"8888*" ?8888u../ 888E 888E
58
+ "88" '888 "Y" "88888% ` ^"F "88888% "888*""888" "Y" "8888P' m888N= 888>
59
+ 88E "YP' "YP' ^Y" ^Y' "P' `Y" 888
60
+ 98> J88"
61
+ '8 @%
62
+ ` :"
63
+ ```
adapter_config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "qresearch/doubutsu-2b-pt-756",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layer_replication": null,
10
+ "layers_pattern": null,
11
+ "layers_to_transform": null,
12
+ "loftq_config": {},
13
+ "lora_alpha": 256,
14
+ "lora_dropout": 0.0,
15
+ "megatron_config": null,
16
+ "megatron_core": "megatron.core",
17
+ "modules_to_save": null,
18
+ "peft_type": "LORA",
19
+ "r": 128,
20
+ "rank_pattern": {},
21
+ "revision": null,
22
+ "target_modules": [
23
+ "gate_proj",
24
+ "q_proj",
25
+ "up_proj",
26
+ "mm_projector.model.0",
27
+ "down_proj",
28
+ "k_proj",
29
+ "v_proj",
30
+ "o_proj",
31
+ "mm_projector.model.2"
32
+ ],
33
+ "task_type": "CAUSAL_LM",
34
+ "use_dora": false,
35
+ "use_rslora": false
36
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f9f4b9a3a828d7e85e87be8f28f11e8087563cac0da24acbe3c2cd63ccc0523
3
+ size 689458008