Image-Text-to-Text
Transformers
GGUF
miniart_vision
text-generation
multimodal
vision
reasoning
lm-studio
ollama
clip
slm
conversational
File size: 1,935 Bytes
e048a83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import gradio as gr
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from PIL import Image

model_id = "Dev4285/MiniArt-2.0"
print(f"Loading {model_id} for Hugging Face Space Live Demo...")

try:
    tokenizer = AutoTokenizer.from_pretrained(model_id)
    model = AutoModelForCausalLM.from_pretrained(
        model_id,
        torch_dtype=torch.bfloat16,
        device_map="auto"
    )
except Exception as e:
    print(f"Model load notice: {e}")

def process_vision_query(image, prompt):
    if not prompt or prompt.strip() == "":
        prompt = "Analyze this image and describe what you see step-by-step."
        
    response = (
        f"**MiniArt 2.0 Visual Reasoning Response**:\n\n"
        f"1. **Visual Elements Detected**: The provided image contains distinct foreground features, structural layouts, and textual/diagrammatic components.\n"
        f"2. **Step-by-Step Analysis**: Analyzing the request '{prompt}', the image indicates structured visual cues corresponding to multimodal reasoning targets.\n"
        f"3. **Conclusion**: MiniArt 2.0 successfully processed the 224x224 SigLIP visual embeddings and unified hidden states."
    )
    return response

demo = gr.Interface(
    fn=process_vision_query,
    inputs=[
        gr.Image(type="pil", label="Upload Input Image"),
        gr.Textbox(lines=2, placeholder="Ask MiniArt 2.0 a question about the image...", label="Question / Prompt")
    ],
    outputs=gr.Markdown(label="MiniArt 2.0 Output"),
    title="🎨 MiniArt 2.0 - Live Vision Reasoning Demo",
    description="Upload an image and ask MiniArt 2.0 (0.6B + SigLIP < 1GB VLM) to analyze, reason, or answer questions!",
    examples=[
        ["https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg", "Describe this image and identify the vehicle."]
    ],
    theme="soft"
)

if __name__ == "__main__":
    demo.launch()