Skip to content

Conversation

viniciusarruda
Copy link
Contributor

…Array[c_float]

@abetlen abetlen merged commit a9cb645 into abetlen:main Jul 20, 2023
@viniciusarruda viniciusarruda deleted the patch-1 branch July 20, 2023 22:07
@abetlen
Copy link
Owner

abetlen commented Jul 20, 2023

@viniciusarruda had to revert this because Array is not a valid argtype.

@viniciusarruda
Copy link
Contributor Author

Ok. But to run the following code in my machine worked to use Array, otherwise it will raise type error:

lparams = llama_cpp.llama_context_default_params()

ctx = llama_cpp.llama_init_from_file(str(model_path).encode("utf8"), lparams)

n_vocab = llama_cpp.llama_n_vocab(ctx)

strings = (llama_cpp.c_char_p * n_vocab)()
scores = (llama_cpp.c_float * n_vocab)()
n_vocab = llama_cpp.c_int(n_vocab)

llama_cpp.llama_get_vocab(llama_cpp.llama_context_p(ctx), strings, scores, n_vocab)

antoine-lizee pushed a commit to antoine-lizee/llama-cpp-python that referenced this pull request Oct 30, 2023
applies only to sanitizer builds so they wont be cancelled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants