Spaces:
Runtime error
Runtime error
Download rust/worker/src/index/utils.rs from expressapi/chroma: direct link, hf CLI and curl.
- Browser
- Download file 337 Bytes
-
https://huggingface.co/spaces/expressapi/chroma/resolve/main/rust/worker/src/index/utils.rs
- Command line
-
hf download hf://spaces/expressapi/chroma/rust/worker/src/index/utils.rs
-
curl -L -o utils.rs https://huggingface.co/spaces/expressapi/chroma/resolve/main/rust/worker/src/index/utils.rs
337 Bytes
| use rand::Rng; | |
| pub(super) fn generate_random_data(n: usize, d: usize) -> Vec<f32> { | |
| let mut rng: rand::prelude::ThreadRng = rand::thread_rng(); | |
| let mut data = vec![0.0f32; n * d]; | |
| // Generate random data | |
| for i in 0..n { | |
| for j in 0..d { | |
| data[i * d + j] = rng.gen(); | |
| } | |
| } | |
| return data; | |
| } | |