Instructions to use kernels-community/mrope_get_position_ids with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use kernels-community/mrope_get_position_ids with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("kernels-community/mrope_get_position_ids", version=1) - Notebooks
- Google Colab
- Kaggle
Download torch-ext/torch_binding.cpp from kernels-community/mrope_get_position_ids: direct link, hf CLI and curl.
- Browser
- Download file 343 Bytes
-
https://huggingface.co/kernels-community/mrope_get_position_ids/resolve/main/torch-ext/torch_binding.cpp
- Command line
-
hf download hf://kernels-community/mrope_get_position_ids/torch-ext/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/kernels-community/mrope_get_position_ids/resolve/main/torch-ext/torch_binding.cpp
343 Bytes
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def("get_position_ids(Tensor out, Tensor input_ids, Tensor " | |
| "image_grid_thw) -> ()"); | |
| ops.impl("get_position_ids", torch::kCUDA, &get_position_ids); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) | |