Skip to content

Commit 0235b9b

Browse files
committed
clip : use ggml_backend_buffer_is_host (#4205)
1 parent ce18d72 commit 0235b9b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

examples/llava/clip.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,7 @@ struct clip_ctx * clip_model_load(const char * fname, const int verbosity = 1) {
598598
return nullptr;
599599
}
600600
int num_bytes = ggml_nbytes(cur);
601-
if (ggml_backend_is_cpu(new_clip->backend)
602-
#ifdef GGML_USE_METAL
603-
|| ggml_backend_is_metal(new_clip->backend)
604-
#endif
605-
) {
601+
if (ggml_backend_buffer_is_host(new_clip->params_buffer)) {
606602
// for the CPU and Metal backend, we can read directly into the tensor
607603
fin.read(reinterpret_cast<char *>(cur->data), num_bytes);
608604
} else {

0 commit comments

Comments
 (0)