Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -166,7 +166,7 @@ class LLMService:
|
|
166 |
|
167 |
self.sd_adapter.init_pipe(vae=vae,
|
168 |
scheduler=noise_scheduler,
|
169 |
-
visual_encoder=self.visual_encoder.
|
170 |
image_transform=self.image_transform,
|
171 |
discrete_model=None,
|
172 |
dtype=self.dtype,
|
@@ -337,7 +337,7 @@ def generate(text_list, image_list, max_new_tokens, force_boi, force_bbox):
|
|
337 |
if output['has_img_output']:
|
338 |
print('loading visual encoder and llm to CPU, and sd to GPU')
|
339 |
a = time.time()
|
340 |
-
service.agent = service.agent.
|
341 |
service.sd_adapter = service.sd_adapter.to(service.vit_sd_device, dtype=service.dtype)
|
342 |
print("Loading finished: ", time.time() - a)
|
343 |
|
@@ -351,7 +351,7 @@ def generate(text_list, image_list, max_new_tokens, force_boi, force_bbox):
|
|
351 |
|
352 |
print('loading visual encoder and llm to GPU, and sd to CPU')
|
353 |
a = time.time()
|
354 |
-
service.sd_adapter = service.sd_adapter.
|
355 |
service.visual_encoder = service.visual_encoder.to(service.vit_sd_device, dtype=service.dtype)
|
356 |
service.agent = service.agent.to(service.vit_sd_device, dtype=service.dtype)
|
357 |
print("Loading finished: ", time.time() - a)
|
|
|
166 |
|
167 |
self.sd_adapter.init_pipe(vae=vae,
|
168 |
scheduler=noise_scheduler,
|
169 |
+
visual_encoder=self.visual_encoder.cpu(),
|
170 |
image_transform=self.image_transform,
|
171 |
discrete_model=None,
|
172 |
dtype=self.dtype,
|
|
|
337 |
if output['has_img_output']:
|
338 |
print('loading visual encoder and llm to CPU, and sd to GPU')
|
339 |
a = time.time()
|
340 |
+
service.agent = service.agent.cpu()
|
341 |
service.sd_adapter = service.sd_adapter.to(service.vit_sd_device, dtype=service.dtype)
|
342 |
print("Loading finished: ", time.time() - a)
|
343 |
|
|
|
351 |
|
352 |
print('loading visual encoder and llm to GPU, and sd to CPU')
|
353 |
a = time.time()
|
354 |
+
service.sd_adapter = service.sd_adapter.cpu()
|
355 |
service.visual_encoder = service.visual_encoder.to(service.vit_sd_device, dtype=service.dtype)
|
356 |
service.agent = service.agent.to(service.vit_sd_device, dtype=service.dtype)
|
357 |
print("Loading finished: ", time.time() - a)
|