mirror of https://github.com/google/gemma.cpp.git
This change adds a basic C API that allows access to Gemma functionality from other programming languages. The functionality is exposed via a shared library (DLL on Windows), with C++ interfaces and a basic C# interop wrapper included. To build the DLL, use the `windows-dll` preset, which includes the C and C++ sources as follows: ``` cmake --preset windows-dll cmake --build --config Release --preset windows-dll -j 4 ``` This should generate a `gemma.dll` in `<build-dir>/Release`. To build for non-Windows, the appropriate C++ DLL linking will need to be done to generate a shared library for the target OS. PiperOrigin-RevId: 750246272 |
||
|---|---|---|
| .. | ||
| benchmark.cc | ||
| benchmark_helper.cc | ||
| benchmark_helper.h | ||
| benchmarks.cc | ||
| cross_entropy.cc | ||
| cross_entropy.h | ||
| debug_prompt.cc | ||
| gemma_batch_bench.cc | ||
| gemma_test.cc | ||
| prompts.h | ||
| run_mmlu.cc | ||