set default simpler
Browse files- inference_manager.py +4 -3
inference_manager.py
CHANGED
@@ -208,7 +208,7 @@ class InferenceManager:
|
|
208 |
except Exception as e:
|
209 |
print(f"Lora {lora_name} not loaded, skipping... {e}")
|
210 |
|
211 |
-
def build_pipeline_with_lora(self, lora_list, sampler=
|
212 |
"""Build the pipeline with specific LoRAs, loading any that are not preloaded."""
|
213 |
# Deep copy the base pipeline
|
214 |
start = time.time()
|
@@ -238,7 +238,8 @@ class InferenceManager:
|
|
238 |
|
239 |
build_time = round(time.time() - start, 2)
|
240 |
print(f"Pipeline built with LoRAs in {build_time}s.")
|
241 |
-
|
|
|
242 |
# Define samplers
|
243 |
samplers = {
|
244 |
"Euler a": EulerAncestralDiscreteScheduler.from_config(temp_pipeline.scheduler.config),
|
@@ -302,7 +303,7 @@ class ModelManager:
|
|
302 |
model_name, _ = os.path.splitext(filename)
|
303 |
return model_name
|
304 |
|
305 |
-
def get_model_pipeline(self, model_id, lora_list, sampler=
|
306 |
"""
|
307 |
Build the pipeline with specific LoRAs for a model.
|
308 |
|
|
|
208 |
except Exception as e:
|
209 |
print(f"Lora {lora_name} not loaded, skipping... {e}")
|
210 |
|
211 |
+
def build_pipeline_with_lora(self, lora_list, sampler=None, new_pipeline=False):
|
212 |
"""Build the pipeline with specific LoRAs, loading any that are not preloaded."""
|
213 |
# Deep copy the base pipeline
|
214 |
start = time.time()
|
|
|
238 |
|
239 |
build_time = round(time.time() - start, 2)
|
240 |
print(f"Pipeline built with LoRAs in {build_time}s.")
|
241 |
+
if not simpler:
|
242 |
+
simpler = self.cfg.get("simpler", "DPM2 a")
|
243 |
# Define samplers
|
244 |
samplers = {
|
245 |
"Euler a": EulerAncestralDiscreteScheduler.from_config(temp_pipeline.scheduler.config),
|
|
|
303 |
model_name, _ = os.path.splitext(filename)
|
304 |
return model_name
|
305 |
|
306 |
+
def get_model_pipeline(self, model_id, lora_list, sampler=None, new_pipeline=False):
|
307 |
"""
|
308 |
Build the pipeline with specific LoRAs for a model.
|
309 |
|