Upload server.py with huggingface_hub
Browse files
server.py
CHANGED
|
@@ -22,8 +22,8 @@ def load_model():
|
|
| 22 |
"zai-org/GLM-Image",
|
| 23 |
torch_dtype=torch.bfloat16,
|
| 24 |
)
|
| 25 |
-
pipe.
|
| 26 |
-
print("[image] Model loaded with
|
| 27 |
|
| 28 |
@app.route("/health", methods=["GET"])
|
| 29 |
def health():
|
|
|
|
| 22 |
"zai-org/GLM-Image",
|
| 23 |
torch_dtype=torch.bfloat16,
|
| 24 |
)
|
| 25 |
+
pipe.enable_model_cpu_offload()
|
| 26 |
+
print("[image] Model loaded with model CPU offload!", flush=True)
|
| 27 |
|
| 28 |
@app.route("/health", methods=["GET"])
|
| 29 |
def health():
|