Download install/examples/test_axcl_api.cpp from AXERA-TECH/LibCLIP: direct link, hf CLI and curl.
- Browser
- Download file 717 Bytes
-
https://huggingface.co/AXERA-TECH/LibCLIP/resolve/main/install/examples/test_axcl_api.cpp
- Command line
-
hf download hf://AXERA-TECH/LibCLIP/install/examples/test_axcl_api.cpp
-
curl -L -o test_axcl_api.cpp https://huggingface.co/AXERA-TECH/LibCLIP/resolve/main/install/examples/test_axcl_api.cpp
717 Bytes
| int main() | |
| { | |
| auto ret = axclInit(); | |
| if (ret != 0) | |
| { | |
| printf("axclInit failed\n"); | |
| return -1; | |
| } | |
| axcl_Dev_Init(0); | |
| ax_runner_axcl runner; | |
| std::ifstream file("cnclip/cnclip_vit_l14_336px_text_u16.axmodel", std::ios::binary); | |
| if (!file.is_open()) | |
| { | |
| printf("open file failed\n"); | |
| return -1; | |
| } | |
| std::vector<uint8_t> model_data((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>()); | |
| runner.init(model_data.data(), model_data.size(), 0); | |
| runner.deinit(); | |
| axcl_Dev_Exit(0); | |
| axclFinalize(); | |
| return 0; | |
| } |