Upload Qwen_Qwen3.5-0.8B-Base_1.txt with huggingface_hub
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344```CODE: # Load model directlyfrom transformers import AutoProcessor, AutoModelForImageTextToText
processor = AutoProcessor.from_pretrained("Qwen/Qwen3.5-0.8B-Base")model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3.5-0.8B-Base")messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] },]inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt",).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))```
ERROR: Traceback (most recent call last): File "/tmp/Qwen_Qwen3.5-0.8B-Base_1zk2T1s.py", line 37, in <module> inputs = processor.apply_chat_template( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ messages, ^^^^^^^^^ ...<3 lines>... return_tensors="pt", ^^^^^^^^^^^^^^^^^^^^ ).to(model.device) ^ File "/tmp/.cache/uv/environments-v2/a2bc340206d73a09/lib/python3.13/site-packages/transformers/processing_utils.py", line 1666, in apply_chat_template raise ValueError( "Cannot use apply_chat_template because this processor does not have a chat template." )ValueError: Cannot use apply_chat_template because this processor does not have a chat template.Qwen_Qwen3.5-0.8B-Base_1.txtAdded+44