AlekseyCalvin commited on
Commit
8be585e
1 Parent(s): ee3a281

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -35,7 +35,7 @@ if clipmodel == "long":
35
  model_id = "zer0int/LongCLIP-GmP-ViT-L-14"
36
  config = CLIPConfig.from_pretrained(model_id)
37
  maxtokens = 248
38
- clip_model = CLIPModel.from_pretrained(model_id, torch_dtype=torch.bfloat16, config=config, ignore_mismatched_sizes=True).to(device)
39
  clip_processor = CLIPProcessor.from_pretrained(model_id, padding="max_length", max_length=maxtokens, ignore_mismatched_sizes=True, return_tensors="pt", truncation=True)
40
  config.text_config.max_position_embeddings = 248
41
 
 
35
  model_id = "zer0int/LongCLIP-GmP-ViT-L-14"
36
  config = CLIPConfig.from_pretrained(model_id)
37
  maxtokens = 248
38
+ clip_model = CLIPModel.from_pretrained(model_id, torch_dtype=torch.bfloat16, config=config, ignore_mismatched_sizes=True).to("cuda")
39
  clip_processor = CLIPProcessor.from_pretrained(model_id, padding="max_length", max_length=maxtokens, ignore_mismatched_sizes=True, return_tensors="pt", truncation=True)
40
  config.text_config.max_position_embeddings = 248
41