silveroxides commited on
Commit
fc1c18e
Β·
verified Β·
1 Parent(s): d15576d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -30,7 +30,7 @@ translator = pipeline("translation", model="Helsinki-NLP/opus-mt-ko-en")
30
  class HFEmbedder(nn.Module):
31
  def __init__(self, version: str, max_length: int, **hf_kwargs):
32
  super().__init__()
33
- self.is_clip = version.startswith("openai")
34
  self.max_length = max_length
35
  self.output_key = "pooler_output" if self.is_clip else "last_hidden_state"
36
 
@@ -63,7 +63,7 @@ class HFEmbedder(nn.Module):
63
 
64
 
65
  device = "cuda"
66
- t5 = HFEmbedder("silveroxides/t5xxl_flan_enc", max_length=512, torch_dtype=torch.bfloat16).to(device)
67
  clip = HFEmbedder("silveroxides/clip-vit-large-patch14", max_length=77, torch_dtype=torch.bfloat16).to(device)
68
  ae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16).to(device)
69
  # quantize(t5, weights=qfloat8)
 
30
  class HFEmbedder(nn.Module):
31
  def __init__(self, version: str, max_length: int, **hf_kwargs):
32
  super().__init__()
33
+ self.is_clip = version.startswith("silveroxides")
34
  self.max_length = max_length
35
  self.output_key = "pooler_output" if self.is_clip else "last_hidden_state"
36
 
 
63
 
64
 
65
  device = "cuda"
66
+ t5 = HFEmbedder("silveroxides/t5xxl_flan_enc", max_length=512, torch_dtype=torch.float16).to(device)
67
  clip = HFEmbedder("silveroxides/clip-vit-large-patch14", max_length=77, torch_dtype=torch.bfloat16).to(device)
68
  ae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16).to(device)
69
  # quantize(t5, weights=qfloat8)