Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -76,13 +76,12 @@ def encode_prompt(prompt_batch, text_encoder, tokenizer, proportion_empty_prompt
|
|
76 |
)
|
77 |
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
prompt_masks = text_inputs.attention_mask.to(device)
|
82 |
|
83 |
prompt_embeds = text_encoder(
|
84 |
-
input_ids=text_input_ids,
|
85 |
-
attention_mask=prompt_masks,
|
86 |
output_hidden_states=True,
|
87 |
).hidden_states[-2]
|
88 |
|
@@ -126,7 +125,7 @@ def model_main(args, master_port, rank, request_queue, response_queue, mp_barrie
|
|
126 |
if args.num_gpus > 1:
|
127 |
raise NotImplementedError("Inference with >1 GPUs not yet supported")
|
128 |
|
129 |
-
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-2b", token=hf_token)
|
130 |
tokenizer.padding_side = "right"
|
131 |
|
132 |
vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", token=hf_token).cuda()
|
|
|
76 |
)
|
77 |
|
78 |
|
79 |
+
text_input_ids = text_inputs.input_ids
|
80 |
+
prompt_masks = text_inputs.attention_mask
|
|
|
81 |
|
82 |
prompt_embeds = text_encoder(
|
83 |
+
input_ids=text_input_ids.cuda(),
|
84 |
+
attention_mask=prompt_masks.cuda(),
|
85 |
output_hidden_states=True,
|
86 |
).hidden_states[-2]
|
87 |
|
|
|
125 |
if args.num_gpus > 1:
|
126 |
raise NotImplementedError("Inference with >1 GPUs not yet supported")
|
127 |
|
128 |
+
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-2b", token=hf_token).cuda()
|
129 |
tokenizer.padding_side = "right"
|
130 |
|
131 |
vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", token=hf_token).cuda()
|