okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
11c8c701a
main
1// src/image/dit/qi21_rope_main.cpp - test program strata-dit-rope (not shipped): writes our RoPE table for a picture. 2// strata-dit-rope <text tokens> <H> <W> <out.bin> float32, 256 a token, text tokens first 3#include "strata/image/qi21_rope.hpp" 4 5#include <cstdio> 6#include <cstdlib> 7 8int main (int argc ,char ** argv ) { 9if (argc < 5 ) { 10 std::fprintf (stderr ,"usage: strata-dit-rope <text tokens> <H> <W> <out.bin>\n" ); 11return 2 ; 12 } 13const auto t = strata::image::qi21_rope_table ( 14 strata::image::qi21_positions (std::atoll (argv [1 ]), std::atoll (argv [2 ]), std::atoll (argv [3 ]))); 15FILE * f = std::fopen (argv [4 ],"wb" ); 16if (!f )return 2 ; 17 std::fwrite (t .data (),sizeof (float ),t .size (),f ); 18 std::fclose (f ); 19return 0 ; 20}