Comments (2)
As far as I can tell, that line of documentation was authored by @ejones - maybe they have some insight into the original intent?
My initial instinct would be to tighten the rules, in case the parser needs to be refactored in the future. In the examples you provided ---dashmaster---
and 12345
seem like particularly egregious rule names that could conflict. (Also, presumably ---
is a valid rule too? That seems nasty.)
On the other hand, if it doesn't cause any parsing issues with the current state, maybe it's worth leaving as is and just updating the documentation, particularly since your integration test above now explicitly tests for these edge cases.
from llama.cpp.
@thekevinscott Thank you for the report!
I just wanted to write and confirm that your report is indeed correct.
Looking through the code, the set of valid identifiers is much larger, and includes anything in the realm of a-zA-Z0-9, and "-". This means that we can have identifiers that are all numbers, pure dashes, identifiers that have the same name but are different cases ("upper-lower-case" and "UPPER-LOWER-CASE" are distinct from each other), etc.
I built an integration test that compiles and runs correctly -- this is a valid grammar (according to the engine) that seems to stretch the rules, and certainly violate the documentation (as you noted):
root ::= simple-identifier
simple-identifier ::= ---dashmaster--- | mIxEd-CaSe | UPPER-LOWER-CASE | upper-lower-case | 12345
---dashmaster--- ::= [-_]+
mIxEd-CaSe ::= [a-z][A-Z][a-z][A-Z]
UPPER-LOWER-CASE ::= [A-Z][A-Z]
upper-lower-case ::= [a-z][a-z]
12345 ::= "67890"
@ochafik / @ggerganov -- feels like a minor issue, so I feel a little bad pinging y'all on this one, but I also struggle with direction-level decisions on my own. Do either of you have opinions? Should we:
- Tighten up the rules re: identifiers (this might break existing grammars that people have been relying on -- I.E. the example from
c.gbnf
) - Or loosen the documentation to note the (greatly) increased flexibility of identifier naming (compared with the current restrictions from the docs) -- such as permitting numbers and upper-case letters?
- Or some mix of the above...?
from llama.cpp.
Related Issues (20)
- Bug: Llama3 8B Instruct Model outputting nonsensical text on AMD GPUs. HOT 2
- The image generated by dockerfile cannot be used
- The image generated by dockerfile cannot be used
- Bug: Server not support mmproj HOT 3
- Bug: Unable to load grammar from `json.gbnf` example HOT 2
- Feature Request: Support for Meta Chameleon 7B and 34B HOT 7
- Bug: Vulkan backend not detecting multiple GPUs anymore HOT 8
- Bug: UwU Emergency! Control Vectors for Qwen2 and Command-r Models Need Fixing! HOT 6
- Bug: ggml-cuda.cu: error: call of overloaded 'forward<std::array<float, 16>&>(std::array<float, 16>&)' is ambiguous HOT 2
- Bug: llama-server + LLava 1.6 hallucinates HOT 2
- Nit: Is `--config Release` necessary?
- server: Bring back multimodal support
- Feature Request: Support for Florence-2 Vision Models HOT 1
- Feature Request: Hardware support check HOT 12
- Bug: Or Feature? BPE Tokenization mutates whitespaces into double-whitespace tokens when add_prefix_space is true (default)
- Bug: Qwen2-72B-Instruct (and finetunes) Q4_K_M generates random output HOT 2
- Bug: Inference is messed up in llama-server+default ui and llama-cli but works in llama-server+openweb ui HOT 1
- Bug: `-fPIC` compiler flag missing in cmake build?
- Bug: Embedding endpoint takes exponential time to process a long unknown token HOT 3
- 我想convert一个比较大的模型时报错Unable to allocate 1.96 GiB for an array with shape (128256, 8192) and data type float16如何解决 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llama.cpp.