llama_cpp_for_radxa_dragon_.../common
Daniel Bevenius e6bf007744
llama : return nullptr from llama_grammar_init (#8093)
* llama : return nullptr from llama_grammar_init

This commit updates llama_grammar_init to return nullptr instead of
throwing an exception.

The motivation for this is that this function is declared inside an
extern "C" block and is intended/may be used from C code which will not
be able to handle exceptions thrown, and results in undefined behavior.

On Windows and using MSVC the following warning is currently generated:
```console
C:\llama.cpp\llama.cpp(13998,1): warning C4297: 'llama_grammar_init':
function assumed not to throw an exception but does
C:\llama.cpp\llama.cpp(13998,1): message :
__declspec(nothrow), throw(), noexcept(true), or noexcept was specified
on the function
```

Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>

* squash! llama : return nullptr from llama_grammar_init

Add checks for nullptr when calling llama_grammar_init.

Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>

---------

Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: Clint Herron <hanclinto@gmail.com>
2024-06-25 15:07:28 -04:00
..
base64.hpp
build-info.cpp.in
CMakeLists.txt cmake : fix BUILD_SHARED_LIBS=ON build (#7784) 2024-06-07 15:15:07 +03:00
common.cpp cvector: better prompt handling, add "mean vector" method (#8069) 2024-06-25 13:59:54 +02:00
common.h cvector: better prompt handling, add "mean vector" method (#8069) 2024-06-25 13:59:54 +02:00
console.cpp
console.h
grammar-parser.cpp Added support for . (any character) token in grammar engine. (#6467) 2024-06-06 06:08:52 -07:00
grammar-parser.h
json-schema-to-grammar.cpp json: support integer minimum, maximum, exclusiveMinimum, exclusiveMaximum (#7797) 2024-06-25 20:06:20 +01:00
json-schema-to-grammar.h JSON: [key] -> .at(key), assert() -> GGML_ASSERT (#7143) 2024-05-08 21:53:08 +02:00
json.hpp
log.h Add support for properly optimized Windows ARM64 builds with LLVM and MSVC (#7191) 2024-05-16 12:47:36 +10:00
ngram-cache.cpp
ngram-cache.h
sampling.cpp llama : return nullptr from llama_grammar_init (#8093) 2024-06-25 15:07:28 -04:00
sampling.h common : normalize naming style (#7462) 2024-05-22 20:04:20 +03:00
stb_image.h
train.cpp train : change default FA argument (#7528) 2024-05-25 15:22:35 +03:00
train.h