mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-09-06 09:51:27 +00:00
wasi_nn_llamacpp.c: explicitly reject unimplemented input index (#4446)
note: wasmedge seems to accept index 1 for metadata. we don't implement it.
This commit is contained in:
parent
d3b0b5c066
commit
fbd27e5e03
|
@ -407,6 +407,11 @@ set_input(void *ctx, graph_execution_context exec_ctx, uint32_t index,
|
|||
return runtime_error;
|
||||
}
|
||||
|
||||
if (index != 0) {
|
||||
NN_ERR_PRINTF("Invalid input index %d", index);
|
||||
return invalid_argument;
|
||||
}
|
||||
|
||||
// tensor->data is the prompt string.
|
||||
char *prompt_text = (char *)wasi_nn_tensor->data.buf;
|
||||
uint32_t prompt_text_len = wasi_nn_tensor->data.size;
|
||||
|
|
Loading…
Reference in New Issue
Block a user