John6666 commited on
Commit
49105de
1 Parent(s): 288f7d3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +52 -51
README.md CHANGED
@@ -1,52 +1,53 @@
1
- ---
2
- license: apache-2.0
3
- datasets:
4
- - google/docci
5
- - google/imageinwords
6
- - ProGamerGov/synthetic-dataset-1m-dalle3-high-quality-captions
7
- language:
8
- - en
9
- library_name: transformers
10
- pipeline_tag: image-text-to-text
11
- tags:
12
- - art
13
- inference: false
14
- ---
15
-
16
- Original model is [here](https://huggingface.co/gokaygokay/Florence-2-SD3-Captioner).
17
- Tagger for local environment is [here](https://huggingface.co/John6666/local_gokaygokay_Florence-2-SD3-Captioner_Tagger).
18
-
19
- ```python
20
- # recipe
21
- from transformers import AutoModelForCausalLM, AutoProcessor, BitsAndBytesConfig
22
- import transformers
23
- import torch
24
- import json
25
-
26
- model_id = 'gokaygokay/Florence-2-SD3-Captioner'
27
- save_path = 'gokaygokay-Florence-2-SD3-Captioner-8bit'
28
-
29
- processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
30
- model = AutoModelForCausalLM.from_pretrained(
31
- model_id,
32
- trust_remote_code=True,
33
- torch_dtype=torch.float32,
34
- low_cpu_mem_usage=True,
35
- quantization_config=BitsAndBytesConfig(
36
- load_in_8bit=True,
37
- llm_int8_threshold=6.0,
38
- llm_int8_enable_fp32_cpu_offload=True,
39
- llm_int8_skip_modules=['lm_head'],
40
- ),
41
- )
42
-
43
- processor.save_pretrained(save_path)
44
- model.save_pretrained(save_path, safe_serialization=True)
45
-
46
- config = {}
47
- with open(f'{save_path}/config.json') as f:
48
- config = json.load(f)
49
- config['vision_config']['model_type'] = 'davit'
50
- with open(f'{save_path}/config.json', 'w') as f:
51
- json.dump(config, f, indent=2)
 
52
  ```
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - google/docci
5
+ - google/imageinwords
6
+ - ProGamerGov/synthetic-dataset-1m-dalle3-high-quality-captions
7
+ language:
8
+ - en
9
+ library_name: transformers
10
+ pipeline_tag: image-text-to-text
11
+ tags:
12
+ - art
13
+ base_model: gokaygokay/Florence-2-SD3-Captioner
14
+ inference: false
15
+ ---
16
+
17
+ Original model is [here](https://huggingface.co/gokaygokay/Florence-2-SD3-Captioner).
18
+ Tagger for local environment is [here](https://huggingface.co/John6666/local_gokaygokay_Florence-2-SD3-Captioner_Tagger).
19
+
20
+ ```python
21
+ # recipe
22
+ from transformers import AutoModelForCausalLM, AutoProcessor, BitsAndBytesConfig
23
+ import transformers
24
+ import torch
25
+ import json
26
+
27
+ model_id = 'gokaygokay/Florence-2-SD3-Captioner'
28
+ save_path = 'gokaygokay-Florence-2-SD3-Captioner-8bit'
29
+
30
+ processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
31
+ model = AutoModelForCausalLM.from_pretrained(
32
+ model_id,
33
+ trust_remote_code=True,
34
+ torch_dtype=torch.float32,
35
+ low_cpu_mem_usage=True,
36
+ quantization_config=BitsAndBytesConfig(
37
+ load_in_8bit=True,
38
+ llm_int8_threshold=6.0,
39
+ llm_int8_enable_fp32_cpu_offload=True,
40
+ llm_int8_skip_modules=['lm_head'],
41
+ ),
42
+ )
43
+
44
+ processor.save_pretrained(save_path)
45
+ model.save_pretrained(save_path, safe_serialization=True)
46
+
47
+ config = {}
48
+ with open(f'{save_path}/config.json') as f:
49
+ config = json.load(f)
50
+ config['vision_config']['model_type'] = 'davit'
51
+ with open(f'{save_path}/config.json', 'w') as f:
52
+ json.dump(config, f, indent=2)
53
  ```