Futuretop commited on
Commit
98d097f
·
verified ·
1 Parent(s): 8389a85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -2,7 +2,7 @@ import os, gc
2
  import gradio as gr
3
  import numpy as np
4
  import random
5
- from transformers import AutoTokenizer, AutoFeatureExtractor
6
  import spaces
7
  from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler
8
  import torch
@@ -16,14 +16,12 @@ if torch.cuda.is_available():
16
  else:
17
  torch_dtype = torch.bfloat16
18
 
19
- tokenizer = AutoTokenizer.from_pretrained(
20
- model_repo_id,
21
- trust_remote_code=True,
22
  use_fast=True
23
  )
24
- feature_extractor = AutoFeatureExtractor.from_pretrained(
25
- model_repo_id,
26
- trust_remote_code=True
27
  )
28
 
29
  # 3) Dispatch & load in FP16 with offloading
 
2
  import gradio as gr
3
  import numpy as np
4
  import random
5
+ from transformers import CLIPTokenizer, CLIPFeatureExtractor
6
  import spaces
7
  from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler
8
  import torch
 
16
  else:
17
  torch_dtype = torch.bfloat16
18
 
19
+ tokenizer = CLIPTokenizer.from_pretrained(
20
+ "openai/clip-vit-base-patch32", # or clip-vit-large if you prefer
 
21
  use_fast=True
22
  )
23
+ feature_extractor = CLIPFeatureExtractor.from_pretrained(
24
+ "openai/clip-vit-base-patch32"
 
25
  )
26
 
27
  # 3) Dispatch & load in FP16 with offloading