Vision / app.py
Staticaliza's picture
Update app.py
0c034e2 verified
raw
history blame
521 Bytes
# Imports
import spaces
import torch
from PIL import Image
from transformers import AutoModel, AutoTokenizer
# Pre-Initialize
DEVICE = "auto"
if DEVICE == "auto":
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
print(f"[SYSTEM] | Using {DEVICE} type compute device.")
# Variables
repo = AutoModel.from_pretrained("openbmb/MiniCPM-V-2_6", torch_dtype=torch.bfloat16, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("openbmb/MiniCPM-V-2_6", trust_remote_code=True)
# Functions
# Initialize