ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / src / ggml-opencl / kernels / embed_kernel.py
| 1 | # |
| 2 | |
| 3 | import sys |
| 4 | import logging |
| 5 | logger = logging.getLogger("opencl-embed-kernel") |
| 6 | |
| 7 | |
| 8 | def main(): |
| 9 | logging.basicConfig(level=logging.INFO) |
| 10 | |
| 11 | if len(sys.argv) != 3: |
| 12 | logger.info("Usage: python embed_kernel.py <input_file> <output_file>") |
| 13 | sys.exit(1) |
| 14 | |
| 15 | ifile = open(sys.argv[1], "r") |
| 16 | ofile = open(sys.argv[2], "w") |
| 17 | |
| 18 | for i in ifile: |
| 19 | ofile.write('R"({})"\n'.format(i)) |
| 20 | |
| 21 | ifile.close() |
| 22 | ofile.close() |
| 23 | |
| 24 | |
| 25 | if __name__ == "__main__": |
| 26 | main() |