redkits commited on
Commit
df61a16
·
verified ·
1 Parent(s): 2ca5d8d

Upload server.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. server.py +2 -3
server.py CHANGED
@@ -21,10 +21,9 @@ def load_model():
21
  pipe = GlmImagePipeline.from_pretrained(
22
  "zai-org/GLM-Image",
23
  torch_dtype=torch.bfloat16,
24
- device_map="cuda",
25
- enable_model_cpu_offload=True,
26
  )
27
- print("[image] Model loaded successfully!", flush=True)
 
28
 
29
  @app.route("/health", methods=["GET"])
30
  def health():
 
21
  pipe = GlmImagePipeline.from_pretrained(
22
  "zai-org/GLM-Image",
23
  torch_dtype=torch.bfloat16,
 
 
24
  )
25
+ pipe.enable_sequential_cpu_offload()
26
+ print("[image] Model loaded with sequential CPU offload!", flush=True)
27
 
28
  @app.route("/health", methods=["GET"])
29
  def health():