Categorygithub.com/go-skynet/go-ggml-transformers.cpp
modulepackage
0.0.0-20230714203132-ffb09d7dd71e
Repository: https://github.com/go-skynet/go-ggml-transformers.cpp.git
Documentation: pkg.go.dev

# README

Go Reference go-ggml-transformers.cpp

ggml golang bindings to run transformers.

The go-llama.cpp bindings are high level, as such most of the work is kept into the C/C++ code to avoid any extra computational cost, be more performant and lastly ease out maintenance, while keeping the usage as simple as possible.

Check out this and this write-ups which summarize the impact of a low-level interface which calls C functions from Go.

If you are looking for an high-level OpenAI compatible API, check out here.

Usage

Note: This repository uses git submodules

Clone the repository locally:

git clone --recurse-submodules https://github.com/go-skynet/go-ggml-transformers.cpp

To build the bindings locally, run:

cd go-ggml-transformers.cpp
make libtransformers.a

Now you can run the example with:

LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run ./examples -m "/model/path/here" -t 14

Enjoy!

The documentation is available here and the full example code is here.

License

MIT

# Packages

No description provided by the author

# Functions

Create a new PredictOptions object with the given options.
SetBatch sets the batch size.
SetSeed sets the random seed for sampling text generation.
SetTemperature sets the temperature value for text generation.
SetThreads sets the number of threads to use for text generation.
SetTokens sets the number of tokens to generate.
SetTopK sets the value for top-K sampling.
SetTopP sets the value for nucleus sampling.

# Variables

No description provided by the author

# Structs

No description provided by the author

# Type aliases

No description provided by the author