File size: 606 Bytes
b7d5f5c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from transformers import (
    AutoModelForCausalLM,
    AutoProcessor,
    AutoImageProcessor,
    AutoConfig,
)

from .processor import (
    Qwen2VLImagePointerProcessor,
    get_processor,
    V1Processor,
    collate_fn,
)
from .modeling_v1 import V1ForConditionalGeneration
from .configuration_v1 import V1Config

print("Registering V1 model and processor with Transformers")
AutoConfig.register("v1", V1Config)
AutoModelForCausalLM.register(
    V1Config, V1ForConditionalGeneration
)
AutoProcessor.register(V1Config, V1Processor)
AutoImageProcessor.register(V1Config, Qwen2VLImagePointerProcessor)