Tj commited on
Commit
baa41dd
·
verified ·
1 Parent(s): 5ce783e

Upload SmolVLM final merged model

Browse files
added_tokens.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "<end_of_utterance>": 49154,
3
+ "<fake_token_around_image>": 49152,
4
+ "<image>": 49153
5
+ }
basic_test.py ADDED
Binary file (58 Bytes). View file
 
chat_template.jinja ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ <|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}<end_of_utterance>
2
+ {% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}
config.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Idefics3ForConditionalGeneration"
4
+ ],
5
+ "image_seq_len": 81,
6
+ "image_token_id": 49153,
7
+ "model_type": "idefics3",
8
+ "pad_token_id": 128002,
9
+ "scale_factor": 3,
10
+ "text_config": {
11
+ "_flash_attn_2_enabled": true,
12
+ "_name_or_path": "/fsx/m4/experiments/local_experiment_dir/s3_async_temporary_checkpoint_folder/tr_324_opt_400/unwrapped_model",
13
+ "architectures": [
14
+ "VLlama3ForCausalLM"
15
+ ],
16
+ "attention_bias": false,
17
+ "attention_dropout": 0.0,
18
+ "bos_token_id": 0,
19
+ "eos_token_id": 0,
20
+ "head_dim": 64,
21
+ "hidden_act": "silu",
22
+ "hidden_size": 2048,
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 8192,
25
+ "max_position_embeddings": 16384,
26
+ "mlp_bias": false,
27
+ "model_type": "llama",
28
+ "neftune_noise_alpha": 0.0,
29
+ "num_attention_heads": 32,
30
+ "num_hidden_layers": 24,
31
+ "num_key_value_heads": 32,
32
+ "pad_token_id": 2,
33
+ "perceiver_config": {
34
+ "_name_or_path": "",
35
+ "add_cross_attention": false,
36
+ "architectures": null,
37
+ "attention_dropout": 0.0,
38
+ "bad_words_ids": null,
39
+ "begin_suppress_tokens": null,
40
+ "bos_token_id": null,
41
+ "chunk_size_feed_forward": 0,
42
+ "cross_attention_hidden_size": null,
43
+ "decoder_start_token_id": null,
44
+ "diversity_penalty": 0.0,
45
+ "do_sample": false,
46
+ "early_stopping": false,
47
+ "encoder_no_repeat_ngram_size": 0,
48
+ "eos_token_id": null,
49
+ "exponential_decay_length_penalty": null,
50
+ "finetuning_task": null,
51
+ "forced_bos_token_id": null,
52
+ "forced_eos_token_id": null,
53
+ "hidden_act": "silu",
54
+ "id2label": {
55
+ "0": "LABEL_0",
56
+ "1": "LABEL_1"
57
+ },
58
+ "is_decoder": false,
59
+ "is_encoder_decoder": false,
60
+ "label2id": {
61
+ "LABEL_0": 0,
62
+ "LABEL_1": 1
63
+ },
64
+ "length_penalty": 1.0,
65
+ "max_length": 20,
66
+ "min_length": 0,
67
+ "model_type": "vllama3",
68
+ "no_repeat_ngram_size": 0,
69
+ "num_beam_groups": 1,
70
+ "num_beams": 1,
71
+ "num_key_value_heads": 1,
72
+ "num_return_sequences": 1,
73
+ "output_attentions": false,
74
+ "output_hidden_states": false,
75
+ "output_scores": false,
76
+ "pad_token_id": null,
77
+ "prefix": null,
78
+ "problem_type": null,
79
+ "pruned_heads": {},
80
+ "qk_layer_norms_perceiver": false,
81
+ "remove_invalid_values": false,
82
+ "repetition_penalty": 1.0,
83
+ "resampler_depth": 6,
84
+ "resampler_head_dim": 96,
85
+ "resampler_n_heads": 16,
86
+ "resampler_n_latents": 64,
87
+ "return_dict": true,
88
+ "return_dict_in_generate": false,
89
+ "sep_token_id": null,
90
+ "suppress_tokens": null,
91
+ "task_specific_params": null,
92
+ "temperature": 1.0,
93
+ "tf_legacy_loss": false,
94
+ "tie_encoder_decoder": false,
95
+ "tie_word_embeddings": true,
96
+ "tokenizer_class": null,
97
+ "top_k": 50,
98
+ "top_p": 1.0,
99
+ "torch_dtype": null,
100
+ "torchscript": false,
101
+ "transformers_version": "4.46.0",
102
+ "typical_p": 1.0,
103
+ "use_bfloat16": false
104
+ },
105
+ "pretraining_tp": 1,
106
+ "qk_layer_norms": false,
107
+ "rms_norm_eps": 1e-05,
108
+ "rope_scaling": null,
109
+ "rope_theta": 273768.0,
110
+ "torch_dtype": "bfloat16",
111
+ "use_cache": true,
112
+ "use_resampler": false,
113
+ "vocab_size": 49155
114
+ },
115
+ "tie_word_embeddings": false,
116
+ "torch_dtype": "bfloat16",
117
+ "transformers.js_config": {
118
+ "dtype": {
119
+ "decoder_model_merged": "q4",
120
+ "embed_tokens": "auto",
121
+ "vision_encoder": "auto"
122
+ },
123
+ "kv_cache_dtype": {
124
+ "fp16": "float16",
125
+ "q4f16": "float16"
126
+ },
127
+ "use_external_data_format": {
128
+ "decoder_model_merged.onnx": true,
129
+ "decoder_model_merged_fp16.onnx": true
130
+ }
131
+ },
132
+ "transformers_version": "4.52.4",
133
+ "use_cache": true,
134
+ "vision_config": {
135
+ "attention_dropout": 0.0,
136
+ "hidden_act": "gelu_pytorch_tanh",
137
+ "hidden_size": 1152,
138
+ "image_size": 384,
139
+ "initializer_range": 0.02,
140
+ "intermediate_size": 4304,
141
+ "layer_norm_eps": 1e-06,
142
+ "max_image_size": {
143
+ "longest_edge": 384
144
+ },
145
+ "model_type": "idefics3_vision",
146
+ "num_attention_heads": 16,
147
+ "num_channels": 3,
148
+ "num_hidden_layers": 27,
149
+ "patch_size": 14,
150
+ "size": {
151
+ "longest_edge": 1920
152
+ },
153
+ "tie_word_embeddings": false,
154
+ "torch_dtype": "bfloat16"
155
+ },
156
+ "vocab_size": 49155
157
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 49154,
5
+ "pad_token_id": 2,
6
+ "transformers_version": "4.52.4"
7
+ }
gradio_trac_automation.py ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import torch
3
+ from transformers import Idefics3ForConditionalGeneration, AutoProcessor
4
+ from PIL import Image
5
+
6
+ # Global variables
7
+ model = None
8
+ processor = None
9
+ device = None
10
+
11
+ def get_device():
12
+ """Determine best device to use"""
13
+ if torch.cuda.is_available():
14
+ return 'cuda:0'
15
+ else:
16
+ return 'cpu'
17
+
18
+ def load_model():
19
+ """Load SmolVLM model with proper device handling"""
20
+ global model, processor, device
21
+
22
+ try:
23
+ print("Loading SmolVLM TRAC Automation Agent...")
24
+
25
+ device = get_device()
26
+ print(f"Using device: {device}")
27
+
28
+ model_path = r"C:\Users\keith\OneDrive\Desktop\admin.trac.jobs-DATA\LLaMA-Factory_local\smolvlm_final_merged"
29
+
30
+ # Load processor first
31
+ processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
32
+ print("✅ Processor loaded")
33
+
34
+ # Load model with explicit device placement
35
+ if device == 'cuda:0':
36
+ # GPU loading
37
+ model = Idefics3ForConditionalGeneration.from_pretrained(
38
+ model_path,
39
+ torch_dtype=torch.bfloat16,
40
+ device_map={'': 0}, # Force all components to GPU 0
41
+ trust_remote_code=True
42
+ )
43
+ else:
44
+ # CPU loading
45
+ model = Idefics3ForConditionalGeneration.from_pretrained(
46
+ model_path,
47
+ torch_dtype=torch.float32, # Use float32 for CPU
48
+ device_map='cpu',
49
+ trust_remote_code=True
50
+ )
51
+
52
+ print(f"✅ Model loaded on {device}")
53
+ return f"✅ Model loaded successfully on {device}! Ready for TRAC automation."
54
+
55
+ except Exception as e:
56
+ error_msg = f"❌ Error loading model: {str(e)}"
57
+ print(error_msg)
58
+ return error_msg
59
+
60
+ def analyze_interface(image, task_type, custom_prompt):
61
+ """Analyze TRAC interface with proper device handling"""
62
+ global model, processor, device
63
+
64
+ if model is None:
65
+ return "❌ Please load the model first."
66
+
67
+ if image is None:
68
+ return "❌ Please upload a TRAC screenshot."
69
+
70
+ try:
71
+ # Convert image to RGB
72
+ if not isinstance(image, Image.Image):
73
+ image = Image.fromarray(image)
74
+ image = image.convert("RGB")
75
+
76
+ # Create task-specific prompts
77
+ if task_type == "Longlisting":
78
+ prompt = """<image>
79
+ Analyze this TRAC interface for LONGLISTING candidates. Identify clickable elements, candidate tables, selection controls, and filtering options. Provide automation steps."""
80
+
81
+ elif task_type == "Shortlisting":
82
+ prompt = """<image>
83
+ Analyze this TRAC interface for SHORTLISTING candidates. Identify evaluation controls, shortlist buttons, and approval workflows. Provide automation steps."""
84
+
85
+ elif task_type == "Interview Setup":
86
+ prompt = """<image>
87
+ Analyze this TRAC interface for INTERVIEW SETUP. Identify scheduling elements, calendar controls, and interviewer assignment. Provide automation steps."""
88
+
89
+ else: # Custom
90
+ if not custom_prompt.strip():
91
+ return "❌ Please enter a custom prompt for analysis."
92
+ prompt = f"<image>\n{custom_prompt}"
93
+
94
+ # Process inputs
95
+ inputs = processor(text=prompt, images=[image], return_tensors="pt")
96
+
97
+ # Move ALL tensors to the same device as model
98
+ if device == 'cuda:0':
99
+ inputs = {k: v.to(device) if torch.is_tensor(v) else v for k, v in inputs.items()}
100
+
101
+ # Generate response
102
+ with torch.no_grad():
103
+ outputs = model.generate(
104
+ **inputs,
105
+ max_new_tokens=250,
106
+ do_sample=True,
107
+ temperature=0.7,
108
+ pad_token_id=processor.tokenizer.eos_token_id if hasattr(processor, 'tokenizer') else None
109
+ )
110
+
111
+ # Decode response
112
+ response = processor.decode(outputs[0], skip_special_tokens=True)
113
+
114
+ # Clean up response
115
+ if prompt in response:
116
+ response = response.replace(prompt, "").strip()
117
+
118
+ response = response.replace("<image>", "").strip()
119
+
120
+ if not response:
121
+ response = "Model generated empty response. Try a different screenshot or prompt."
122
+
123
+ return response
124
+
125
+ except Exception as e:
126
+ error_msg = f"❌ Analysis Error: {str(e)}"
127
+ print(error_msg)
128
+ return error_msg
129
+
130
+ def create_app():
131
+ """Create Gradio interface"""
132
+ with gr.Blocks(title="SmolVLM TRAC Automation") as demo:
133
+
134
+ gr.Markdown("""
135
+ # 🎯 SmolVLM TRAC Automation Agent
136
+
137
+ **AI Assistant for HR Administrative Tasks**
138
+ - 📋 Longlisting candidates
139
+ - ⭐ Shortlisting applications
140
+ - 📅 Interview setup & scheduling
141
+ """)
142
+
143
+ with gr.Row():
144
+ with gr.Column():
145
+ # Model loading
146
+ load_btn = gr.Button("🚀 Load Model", variant="primary")
147
+ status = gr.Textbox(label="Status", value="Model not loaded")
148
+
149
+ # Image upload
150
+ image_input = gr.Image(label="TRAC Screenshot", type="pil")
151
+
152
+ # Task selection
153
+ task_type = gr.Radio(
154
+ choices=["Longlisting", "Shortlisting", "Interview Setup", "Custom"],
155
+ value="Longlisting",
156
+ label="Task Type"
157
+ )
158
+
159
+ # Custom prompt
160
+ custom_prompt = gr.Textbox(
161
+ label="Custom Prompt",
162
+ placeholder="Describe what to analyze...",
163
+ lines=3
164
+ )
165
+
166
+ analyze_btn = gr.Button("🔍 Analyze", variant="primary")
167
+
168
+ with gr.Column():
169
+ result = gr.Textbox(
170
+ label="Automation Instructions",
171
+ lines=15,
172
+ show_copy_button=True
173
+ )
174
+
175
+ # Event handlers
176
+ load_btn.click(load_model, outputs=status)
177
+ analyze_btn.click(
178
+ analyze_interface,
179
+ inputs=[image_input, task_type, custom_prompt],
180
+ outputs=result
181
+ )
182
+
183
+ return demo
184
+
185
+ if __name__ == "__main__":
186
+ print("🌐 Starting SmolVLM TRAC Automation Interface...")
187
+ app = create_app()
188
+ app.launch(inbrowser=True)
install_gradio.bat ADDED
Binary file (144 Bytes). View file
 
merge_info.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "total_batch_models": 14,
3
+ "successfully_merged": 14,
4
+ "base_model": "HuggingFaceTB/SmolVLM-Instruct",
5
+ "final_model_path": "smolvlm_final_merged",
6
+ "merged_model_paths": [
7
+ "smolvlm_batched_training_final\\batch_000\\final_model",
8
+ "smolvlm_batched_training_final\\batch_001\\final_model",
9
+ "smolvlm_batched_training_final\\batch_002\\final_model",
10
+ "smolvlm_batched_training_final\\batch_003\\final_model",
11
+ "smolvlm_batched_training_final\\batch_004\\final_model",
12
+ "smolvlm_batched_training_final\\batch_005\\final_model",
13
+ "smolvlm_batched_training_final\\batch_006\\final_model",
14
+ "smolvlm_batched_training_final\\batch_007\\final_model",
15
+ "smolvlm_batched_training_final\\batch_008\\final_model",
16
+ "smolvlm_batched_training_final\\batch_009\\final_model",
17
+ "smolvlm_batched_training_final\\batch_010\\final_model",
18
+ "smolvlm_batched_training_final\\batch_011\\final_model",
19
+ "smolvlm_batched_training_final\\batch_012\\final_model",
20
+ "smolvlm_batched_training_final\\batch_013\\final_model"
21
+ ]
22
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a4f76cb64f6f2e4e74716d8fc1cfc6a70bbb3eeea69d424c3ec9902655065eb
3
+ size 4492630912
preprocessor_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": true,
3
+ "do_image_splitting": true,
4
+ "do_normalize": true,
5
+ "do_pad": true,
6
+ "do_rescale": true,
7
+ "do_resize": true,
8
+ "image_mean": [
9
+ 0.5,
10
+ 0.5,
11
+ 0.5
12
+ ],
13
+ "image_processor_type": "Idefics3ImageProcessor",
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "max_image_size": {
20
+ "longest_edge": 384
21
+ },
22
+ "processor_class": "Idefics3Processor",
23
+ "resample": 1,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "longest_edge": 1536
27
+ }
28
+ }
processor_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "image_seq_len": 81,
3
+ "processor_class": "Idefics3Processor"
4
+ }
run_model.bat ADDED
@@ -0,0 +1 @@
 
 
1
+ cd "C:\Users\keith\OneDrive\Desktop\admin.trac.jobs-DATA\LLaMA-Factory_local\smolvlm_final_merged" && "C:\Users\keith\AppData\Local\Programs\Python\Python313\python.exe" test_ui_agent.py
special_tokens_map.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ {
4
+ "content": "<fake_token_around_image>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ {
11
+ "content": "<image>",
12
+ "lstrip": false,
13
+ "normalized": false,
14
+ "rstrip": false,
15
+ "single_word": false
16
+ },
17
+ {
18
+ "content": "<end_of_utterance>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ ],
25
+ "bos_token": {
26
+ "content": "<|im_start|>",
27
+ "lstrip": false,
28
+ "normalized": false,
29
+ "rstrip": false,
30
+ "single_word": false
31
+ },
32
+ "eos_token": {
33
+ "content": "<end_of_utterance>",
34
+ "lstrip": false,
35
+ "normalized": false,
36
+ "rstrip": false,
37
+ "single_word": false
38
+ },
39
+ "pad_token": {
40
+ "content": "<|im_end|>",
41
+ "lstrip": false,
42
+ "normalized": false,
43
+ "rstrip": false,
44
+ "single_word": false
45
+ },
46
+ "unk_token": {
47
+ "content": "<|endoftext|>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": false,
51
+ "single_word": false
52
+ }
53
+ }
test_ui_agent.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ SmolVLM UI Automation Agent - Test Script
3
+ Your trained model is ready!
4
+ """
5
+
6
+ import torch
7
+ from transformers import Idefics3ForConditionalGeneration, AutoProcessor
8
+ from PIL import Image
9
+ import os
10
+
11
+ def load_model():
12
+ """Load your trained SmolVLM model"""
13
+ model_path = r"C:\Users\keith\OneDrive\Desktop\admin.trac.jobs-DATA\LLaMA-Factory_local\smolvlm_final_merged"
14
+
15
+ print("Loading your trained SmolVLM UI automation agent...")
16
+ model = Idefics3ForConditionalGeneration.from_pretrained(
17
+ model_path,
18
+ torch_dtype=torch.bfloat16,
19
+ device_map="auto",
20
+ trust_remote_code=True
21
+ )
22
+
23
+ processor = AutoProcessor.from_pretrained(model_path)
24
+ print("Model loaded successfully!")
25
+ return model, processor
26
+
27
+ def analyze_screenshot(image_path: str, model, processor):
28
+ """Analyze a screenshot for UI automation"""
29
+
30
+ # Load and process image
31
+ image = Image.open(image_path).convert("RGB")
32
+ prompt = "<image>\nAnalyze this interface for UI automation opportunities. Identify clickable elements and automation targets."
33
+
34
+ # Process inputs
35
+ inputs = processor(text=prompt, images=[image], return_tensors="pt")
36
+
37
+ # Generate response
38
+ with torch.no_grad():
39
+ outputs = model.generate(
40
+ **inputs,
41
+ max_new_tokens=150,
42
+ do_sample=True,
43
+ temperature=0.7,
44
+ top_p=0.9
45
+ )
46
+
47
+ # Decode response
48
+ response = processor.decode(outputs[0], skip_special_tokens=True)
49
+
50
+ # Extract just the assistant's response
51
+ if "Assistant:" in response:
52
+ response = response.split("Assistant:")[-1].strip()
53
+
54
+ return response
55
+
56
+ def main():
57
+ print("🤖 SmolVLM UI Automation Agent")
58
+ print("=" * 50)
59
+ print("Your custom-trained model for TRAC administration!")
60
+ print()
61
+
62
+ try:
63
+ # Load your trained model
64
+ model, processor = load_model()
65
+
66
+ while True:
67
+ print("\nOptions:")
68
+ print("1. Analyze a screenshot")
69
+ print("2. Quit")
70
+
71
+ choice = input("\nEnter choice (1-2): ").strip()
72
+
73
+ if choice == "1":
74
+ image_path = input("Enter path to screenshot: ").strip().strip('"')
75
+
76
+ if os.path.exists(image_path):
77
+ print("\n🔍 Analyzing screenshot...")
78
+ try:
79
+ result = analyze_screenshot(image_path, model, processor)
80
+ print("\n🎯 Analysis Result:")
81
+ print("-" * 30)
82
+ print(result)
83
+ print("-" * 30)
84
+ except Exception as e:
85
+ print(f"❌ Analysis error: {e}")
86
+ else:
87
+ print("❌ Image file not found!")
88
+
89
+ elif choice == "2":
90
+ print("👋 Goodbye!")
91
+ break
92
+ else:
93
+ print("❌ Invalid choice!")
94
+
95
+ except Exception as e:
96
+ print(f"❌ Error loading model: {e}")
97
+ print("Make sure the model was merged successfully.")
98
+
99
+ if __name__ == "__main__":
100
+ main()
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<|im_start|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<repo_name>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "<reponame>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "5": {
45
+ "content": "<file_sep>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "6": {
53
+ "content": "<filename>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "7": {
61
+ "content": "<gh_stars>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "8": {
69
+ "content": "<issue_start>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "9": {
77
+ "content": "<issue_comment>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "10": {
85
+ "content": "<issue_closed>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "11": {
93
+ "content": "<jupyter_start>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "12": {
101
+ "content": "<jupyter_text>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "13": {
109
+ "content": "<jupyter_code>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "14": {
117
+ "content": "<jupyter_output>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": true
123
+ },
124
+ "15": {
125
+ "content": "<jupyter_script>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": true
131
+ },
132
+ "16": {
133
+ "content": "<empty_output>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": true
139
+ },
140
+ "49152": {
141
+ "content": "<fake_token_around_image>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": true
147
+ },
148
+ "49153": {
149
+ "content": "<image>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": true
155
+ },
156
+ "49154": {
157
+ "content": "<end_of_utterance>",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": true
163
+ }
164
+ },
165
+ "additional_special_tokens": [
166
+ "<fake_token_around_image>",
167
+ "<image>",
168
+ "<end_of_utterance>"
169
+ ],
170
+ "bos_token": "<|im_start|>",
171
+ "clean_up_tokenization_spaces": false,
172
+ "eos_token": "<end_of_utterance>",
173
+ "extra_special_tokens": {},
174
+ "legacy": false,
175
+ "model_max_length": 16384,
176
+ "pad_token": "<|im_end|>",
177
+ "processor_class": "Idefics3Processor",
178
+ "tokenizer_class": "GPT2Tokenizer",
179
+ "truncation_side": "left",
180
+ "unk_token": "<|endoftext|>",
181
+ "vocab_size": 49152
182
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff