Upload text_encoder/README.md with huggingface_hub
Browse files- text_encoder/README.md +120 -0
text_encoder/README.md
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
- zh
|
6 |
+
- th
|
7 |
+
base_model:
|
8 |
+
- Qwen/Qwen2.5-VL-7B-Instruct
|
9 |
+
tags:
|
10 |
+
- text-generation-inference
|
11 |
+
- uncensored
|
12 |
+
- image-captioning
|
13 |
+
- vlm
|
14 |
+
- visual-understanding
|
15 |
+
- caption
|
16 |
+
- image-to-text
|
17 |
+
pipeline_tag: image-text-to-text
|
18 |
+
library_name: transformers
|
19 |
+
datasets:
|
20 |
+
- prithivMLmods/blip3o-caption-mini-arrow
|
21 |
+
- prithivMLmods/Caption3o-Opt-v2
|
22 |
+
---
|
23 |
+
|
24 |
+

|
25 |
+
|
26 |
+
# **Qwen2.5-VL-7B-Abliterated-Caption-it**
|
27 |
+
|
28 |
+
> The **Qwen2.5-VL-7B-Abliterated-Caption-it** model is a fine-tuned version of **Qwen2.5-VL-7B-Instruct**, tailored for **Abliterated Captioning** / **Uncensored Image Captioning**. This variant is designed to generate highly detailed and descriptive captions across a broad range of visual categories, including images with complex, sensitive, or nuanced content—across varying aspect ratios and resolutions.
|
29 |
+
|
30 |
+
# Key Highlights
|
31 |
+
|
32 |
+
* **Abliterated / Uncensored Captioning**: Fine-tuned to bypass common content filters while preserving factual and descriptive richness across diverse visual categories.
|
33 |
+
|
34 |
+
* **High-Fidelity Descriptions**: Generates comprehensive captions for general, artistic, technical, abstract, and low-context images.
|
35 |
+
|
36 |
+
* **Robust Across Aspect Ratios**: Capable of accurately captioning images with wide, tall, square, and irregular dimensions.
|
37 |
+
|
38 |
+
* **Variational Detail Control**: Produces outputs with both high-level summaries and fine-grained descriptions as needed.
|
39 |
+
|
40 |
+
* **Foundation on Qwen2.5-VL Architecture**: Leverages the strengths of the Qwen2.5-VL-7B multimodal model for visual reasoning, comprehension, and instruction-following.
|
41 |
+
|
42 |
+
* **Multilingual Output Capability**: Can support multilingual descriptions (English as default), adaptable via prompt engineering.
|
43 |
+
|
44 |
+
# Training Details
|
45 |
+
|
46 |
+
This model was fine-tuned using the following datasets:
|
47 |
+
|
48 |
+
* **[prithivMLmods/blip3o-caption-mini-arrow](https://huggingface.co/datasets/prithivMLmods/blip3o-caption-mini-arrow)**
|
49 |
+
* **[prithivMLmods/Caption3o-Opt-v2](https://huggingface.co/datasets/prithivMLmods/Caption3o-Opt-v2)**
|
50 |
+
* **Private/unlisted datasets** curated for uncensored and domain-specific image captioning tasks.
|
51 |
+
|
52 |
+
The training objective focused on enhancing performance in unconstrained, descriptive image captioning—especially for edge cases commonly filtered out in standard captioning benchmarks.
|
53 |
+
|
54 |
+
# Quick Start with Transformers
|
55 |
+
|
56 |
+
> [!note]
|
57 |
+
Instruction Query: Provide a detailed caption for the image
|
58 |
+
|
59 |
+
```python
|
60 |
+
from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
|
61 |
+
from qwen_vl_utils import process_vision_info
|
62 |
+
|
63 |
+
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
64 |
+
"prithivMLmods/Qwen2.5-VL-7B-Abliterated-Caption-it", torch_dtype="auto", device_map="auto"
|
65 |
+
)
|
66 |
+
|
67 |
+
processor = AutoProcessor.from_pretrained("prithivMLmods/Qwen2.5-VL-7B-Abliterated-Caption-it")
|
68 |
+
|
69 |
+
messages = [
|
70 |
+
{
|
71 |
+
"role": "user",
|
72 |
+
"content": [
|
73 |
+
{
|
74 |
+
"type": "image",
|
75 |
+
"image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
|
76 |
+
},
|
77 |
+
{"type": "text", "text": "Describe this image in detail."},
|
78 |
+
],
|
79 |
+
}
|
80 |
+
]
|
81 |
+
|
82 |
+
text = processor.apply_chat_template(
|
83 |
+
messages, tokenize=False, add_generation_prompt=True
|
84 |
+
)
|
85 |
+
image_inputs, video_inputs = process_vision_info(messages)
|
86 |
+
inputs = processor(
|
87 |
+
text=[text],
|
88 |
+
images=image_inputs,
|
89 |
+
videos=video_inputs,
|
90 |
+
padding=True,
|
91 |
+
return_tensors="pt",
|
92 |
+
)
|
93 |
+
inputs = inputs.to("cuda")
|
94 |
+
|
95 |
+
generated_ids = model.generate(**inputs, max_new_tokens=128)
|
96 |
+
generated_ids_trimmed = [
|
97 |
+
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
|
98 |
+
]
|
99 |
+
output_text = processor.batch_decode(
|
100 |
+
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
|
101 |
+
)
|
102 |
+
print(output_text)
|
103 |
+
```
|
104 |
+
|
105 |
+
# Intended Use
|
106 |
+
|
107 |
+
This model is suited for:
|
108 |
+
|
109 |
+
* Generating detailed and unfiltered image captions for general-purpose or artistic datasets.
|
110 |
+
* Content moderation research, red-teaming, and generative safety evaluations.
|
111 |
+
* Enabling descriptive captioning for visual datasets typically excluded from mainstream models.
|
112 |
+
* Use in creative applications (e.g., storytelling, art generation) that benefit from rich descriptive captions.
|
113 |
+
* Captioning for non-standard aspect ratios and stylized visual content.
|
114 |
+
|
115 |
+
# Limitations
|
116 |
+
|
117 |
+
* May produce explicit, sensitive, or offensive descriptions depending on image content and prompts.
|
118 |
+
* Not suitable for deployment in production systems requiring content filtering or moderation.
|
119 |
+
* Can exhibit variability in caption tone or style depending on input prompt phrasing.
|
120 |
+
* Accuracy for unfamiliar or synthetic visual styles may vary.
|