Spaces:
Runtime error
Runtime error
Update optimization.py
Browse files- optimization.py +1 -2
optimization.py
CHANGED
|
@@ -42,8 +42,6 @@ def optimize_pipeline_(pipeline: Callable[P, Any], *args: P.args, **kwargs: P.kw
|
|
| 42 |
|
| 43 |
@spaces.GPU(duration=1500)
|
| 44 |
def compile_transformer():
|
| 45 |
-
|
| 46 |
-
quantize_(pipeline.text_encoder, Int8WeightOnlyConfig()) # Just to free-up some GPU memory
|
| 47 |
|
| 48 |
with capture_component_call(pipeline, 'transformer') as call:
|
| 49 |
pipeline(*args, **kwargs)
|
|
@@ -89,6 +87,7 @@ def optimize_pipeline_(pipeline: Callable[P, Any], *args: P.args, **kwargs: P.kw
|
|
| 89 |
compiled_portrait_2,
|
| 90 |
)
|
| 91 |
|
|
|
|
| 92 |
cl1, cl2, cp1, cp2 = compile_transformer()
|
| 93 |
|
| 94 |
def combined_transformer_1(*args, **kwargs):
|
|
|
|
| 42 |
|
| 43 |
@spaces.GPU(duration=1500)
|
| 44 |
def compile_transformer():
|
|
|
|
|
|
|
| 45 |
|
| 46 |
with capture_component_call(pipeline, 'transformer') as call:
|
| 47 |
pipeline(*args, **kwargs)
|
|
|
|
| 87 |
compiled_portrait_2,
|
| 88 |
)
|
| 89 |
|
| 90 |
+
quantize_(pipeline.text_encoder, Int8WeightOnlyConfig())
|
| 91 |
cl1, cl2, cp1, cp2 = compile_transformer()
|
| 92 |
|
| 93 |
def combined_transformer_1(*args, **kwargs):
|