Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,6 @@ hf_token = os.environ["HF_TOKEN"]
|
|
22 |
|
23 |
import argparse
|
24 |
import os
|
25 |
-
#os.environ['CUDA_VISIBLE_DEVICES'] = '7'
|
26 |
import builtins
|
27 |
import json
|
28 |
import math
|
@@ -51,9 +50,6 @@ from multiprocessing import Process,Queue,set_start_method,get_context
|
|
51 |
class ModelFailure:
|
52 |
pass
|
53 |
|
54 |
-
gemma_path = "/home/user/app/checkpoints/text_encoder"
|
55 |
-
flux_path = "/home/user/app/checkpoints/vae"
|
56 |
-
#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
|
57 |
# Adapted from pipelines.StableDiffusionXLPipeline.encode_prompt
|
58 |
def encode_prompt(prompt_batch, text_encoder, tokenizer, proportion_empty_prompts, is_train=True):
|
59 |
captions = []
|
@@ -73,7 +69,7 @@ def encode_prompt(prompt_batch, text_encoder, tokenizer, proportion_empty_prompt
|
|
73 |
max_length=256,
|
74 |
truncation=True,
|
75 |
return_tensors="pt",
|
76 |
-
)
|
77 |
|
78 |
print(f"Text Encoder Device: {text_encoder.device}")
|
79 |
text_input_ids = text_inputs.input_ids.cuda()
|
|
|
22 |
|
23 |
import argparse
|
24 |
import os
|
|
|
25 |
import builtins
|
26 |
import json
|
27 |
import math
|
|
|
50 |
class ModelFailure:
|
51 |
pass
|
52 |
|
|
|
|
|
|
|
53 |
# Adapted from pipelines.StableDiffusionXLPipeline.encode_prompt
|
54 |
def encode_prompt(prompt_batch, text_encoder, tokenizer, proportion_empty_prompts, is_train=True):
|
55 |
captions = []
|
|
|
69 |
max_length=256,
|
70 |
truncation=True,
|
71 |
return_tensors="pt",
|
72 |
+
)
|
73 |
|
74 |
print(f"Text Encoder Device: {text_encoder.device}")
|
75 |
text_input_ids = text_inputs.input_ids.cuda()
|