rahul7star commited on
Commit
c7eb226
·
verified ·
1 Parent(s): 8112ed5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -82,6 +82,19 @@ PRESETS = {
82
  # token=HF_TOKEN,
83
  # )
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  pipe = Ideogram4Pipeline.from_pretrained(
86
  BASE_REPO,
87
  text_encoder=text_encoder,
 
82
  # token=HF_TOKEN,
83
  # )
84
 
85
+
86
+ if TEXT_ENCODER_ID:
87
+ text_encoder = AutoModel.from_pretrained(
88
+ TEXT_ENCODER_ID,
89
+ torch_dtype=torch.bfloat16,
90
+ token=HF_TOKEN,
91
+ low_cpu_mem_usage=True,
92
+ )
93
+ print(f"[model] using alternate text encoder: {TEXT_ENCODER_ID}", flush=True)
94
+ else:
95
+ text_encoder = None
96
+
97
+
98
  pipe = Ideogram4Pipeline.from_pretrained(
99
  BASE_REPO,
100
  text_encoder=text_encoder,