You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by **FreakTheMighty** May 2, 2024
I'm using the example swiftui application as a starting place and would like to add grammar constraints. I'm a bit stuck on how to actually load a grammar file. In the c++ examples, the [grammar_parser::parse](https://github.com/ggerganov/llama.cpp/blob/master/common/grammar-parser.h), but in swift this API doesn't appear to be exposed.
Any suggested on how to load a grammar would be much appreciated.
Would it be possible to expand the Swift package to include more functionality found in common?
The text was updated successfully, but these errors were encountered:
spprichard
changed the title
Loading Grammar From Swift
Expanding Swift Package Functionality
May 9, 2024
The logic is that everything inside the examples folder is a demonstration of how to use the llama.cpp library that currently has only a C-style API defined in llama.h. There are many useful bits in the examples and especially in common that with time, as they mature, make their way into the core llama library, available through the C-style API. The grammar parser is one such thing that will at some point get tightly integrated - just need developer time to find the best way
We don't want to expose a C++ API of the stuff in common because C++ APIs are very difficult to adopt compared to C-style APIs and it is not worth the effort.
Would it be possible to expand the Swift package to include more functionality found in common?
For now, it's better to replicate the common functionality that you are interested in your Swift project.
Discussed in #7053
Any suggested on how to load a grammar would be much appreciated.
Would it be possible to expand the Swift package to include more functionality found in
common
?The text was updated successfully, but these errors were encountered: