We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 613dcae commit f0762ddCopy full SHA for f0762dd
wasmedge-ggml/embedding/src/main.rs
@@ -49,8 +49,9 @@ fn set_metadata_to_context(
49
}
50
51
fn get_data_from_context(context: &GraphExecutionContext, index: usize) -> String {
52
- // Preserve for 4096 tokens with average token length 15
53
- const MAX_OUTPUT_BUFFER_SIZE: usize = 4096 * 15 + 128;
+ // Preserve for 4096 embedding size and each embedding number is length 20,
+ // and add 128 bytes for other information such as "n_embedding" of other symbols.
54
+ const MAX_OUTPUT_BUFFER_SIZE: usize = 4096 * 20 + 128;
55
let mut output_buffer = vec![0u8; MAX_OUTPUT_BUFFER_SIZE];
56
let mut output_size = context.get_output(index, &mut output_buffer).unwrap();
57
output_size = std::cmp::min(MAX_OUTPUT_BUFFER_SIZE, output_size);
wasmedge-ggml/embedding/wasmedge-ggml-llama-embedding.wasm
-424 KB
0 commit comments