Update app.py
Browse files116 unmodified lines117118119120121122123124125120121122123124125132126127128135136137138139140141129130131132116 unmodified lines transforms.CenterCrop((384, 384)),])
model_file = huggingface_hub.hf_hub_download( repo_id="RedRocket/JointTaggerProject", filename="JTP_PILOT-e4-vit_so400m_patch14_siglip_384.safetensors", subfolder="JTP_PILOT")
model = timm.create_model( "vit_so400m_patch14_siglip_384.webli", pretrained=False, num_classes=9083,) # type: VisionTransformer
safetensors.torch.load_model(model, model_file)safetensors.torch.load_model(model, "JTP_PILOT-e4-vit_so400m_patch14_siglip_384.safetensors")model.eval()
tags_file = huggingface_hub.hf_hub_download( repo_id="RedRocket/JointTaggerProject", filename="tags.json", subfolder="JTP_PILOT")
with open(tags_file, "r") as file:with open("tags.json", "r") as file: tags = json.load(file) # type: dictallowed_tags = tags.keys()
app.py+2-14