MisterAI commited on
Commit
6e63c31
·
verified ·
1 Parent(s): 1bd86ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -7
app.py CHANGED
@@ -68,15 +68,22 @@ class FluxGenerator:
68
  # )
69
 
70
 
 
 
 
 
 
 
 
 
 
71
  self.pipeline = FluxPipeline.from_pretrained(
72
  "black-forest-labs/FLUX.1-schnell",
73
  revision="refs/pr/1",
74
- device_map="balanced", # Utilise une chaîne de caractères au lieu d'un dictionnaire
75
- **model_kwargs
76
- )
77
-
78
-
79
-
80
 
81
 
82
 
@@ -170,4 +177,4 @@ demo = gr.Interface(
170
  )
171
 
172
  if __name__ == "__main__":
173
- demo.launch()
 
68
  # )
69
 
70
 
71
+ #ERREUR `add_prefix_space`. The tokenizer needs to be converted from the slow tokenizers
72
+ # self.pipeline = FluxPipeline.from_pretrained(
73
+ # "black-forest-labs/FLUX.1-schnell",
74
+ # revision="refs/pr/1",
75
+ # device_map="balanced", # Utilise une chaîne de caractères au lieu d'un dictionnaire
76
+ # **model_kwargs
77
+ # )
78
+
79
+
80
  self.pipeline = FluxPipeline.from_pretrained(
81
  "black-forest-labs/FLUX.1-schnell",
82
  revision="refs/pr/1",
83
+ device_map="auto",
84
+ torch_dtype=torch.float32,
85
+ use_safetensors=True
86
+ )
 
 
87
 
88
 
89
 
 
177
  )
178
 
179
  if __name__ == "__main__":
180
+ demo.launch()