Views
No views yet
| Attribute | Value |
|---|---|
| Vocab Size | 151936 |
| Hidden Size | 2048 |
| Intermediate Size | 11008 |
| Max Position Embeddings | 128000 |
| Attention Heads | 16 |
| Key Value Heads | 2 |
transformers>=4.41.0
torch>=2.0.0
Pillow>=9.0.01from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
2import torch
3
4# Load model and processor
5model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
6 "your-hf-username/GUISwiper",
7 torch_dtype=torch.bfloat16,
8 device_map="auto"
9)
10processor = AutoProcessor.from_pretrained("your-hf-username/GUISwiper")
11
12# Prepare messages
13messages = [
14 {
15 "role": "user",
16 "content": [
17 {"type": "text", "text": "Describe this image."}
18 ]
19 }
20]
21
22# Process and generate
23text_prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
24inputs = processor(text=[messages], return_tensors="pt").to(model.device)
25
26with torch.no_grad():
27 output_ids = model.generate(**inputs, max_new_tokens=100)
28
29response = processor.batch_decode(output_ids[:, inputs.input_ids.shape[1]:], skip_special_tokens=True)[0]
30print(response)