File size: 568 Bytes
b7be07b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import torch
from transformers import AutoProcessor, AutoTokenizer

class Config:

    EOS_TOKEN_ID = 50256
    QUESTION_ANSWER_SEPARATOR_ID = 50295  # Special token ID for question-answer separation
    IMAGE_SEPARATOR_TOKENS = [685, 36259, 14041, 60, 220]

    phi_model_name = "microsoft/phi-2"
    model_name = "openai/clip-vit-base-patch32"
    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    
    processor = AutoProcessor.from_pretrained(model_name)
    tokenizer = AutoTokenizer.from_pretrained(phi_model_name, trust_remote_code=True)