File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ struct rwkv_context * rwkv_init_from_file(const char * file_path, const uint32_t
8080 ctx->n_threads = n_threads;
8181
8282 if (n_gpu_layers) {
83- ggml_backend_t backend;
83+ ggml_backend_t backend = nullptr ;
8484
8585#ifdef GGML_USE_CUDA
8686 backend = ggml_backend_cuda_init (0 );
@@ -97,9 +97,9 @@ struct rwkv_context * rwkv_init_from_file(const char * file_path, const uint32_t
9797 RWKV_ENSURE_OR_NULL (backend);
9898 ggml_backend_blas_set_n_threads (backend, ctx->n_threads );
9999#endif
100- RWKV_ENSURE_OR_NULL (backend);
101-
102- ctx-> model -> backends . push_back (backend);
100+ if (backend != nullptr ) {
101+ ctx-> model -> backends . push_back (backend);
102+ }
103103 }
104104
105105 ggml_backend_t cpu_backend = ggml_backend_cpu_init ();
You can’t perform that action at this time.
0 commit comments