Transformers
English
Sanskrit
swe-bench
swe-bench-verified
panini-grammar
ast-invariants
code-repair
automated-program-repair
gemma
neuro-symbolic
formal-methods
test-driven-development
Eval Results (legacy)
Instructions to use 18kansal/panini4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 18kansal/panini4b with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("18kansal/panini4b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download panini_code.gbnf from 18kansal/panini4b: direct link, hf CLI and curl.
- Browser
- Download file 905 Bytes
-
https://huggingface.co/18kansal/panini4b/resolve/main/panini_code.gbnf
- Command line
-
hf download hf://18kansal/panini4b/panini_code.gbnf
-
curl -L -o panini_code.gbnf https://huggingface.co/18kansal/panini4b/resolve/main/panini_code.gbnf
905 Bytes
| # panini_code.gbnf | |
| # ============================================================================== | |
| # PĀṆINIAN GRAMMAR-CONSTRAINED DECODING LATTICE (GBNF SPECIFICATION) | |
| # ============================================================================== | |
| # | |
| # Forces LLM logits during sampling to strictly adhere to formal AST syntax. | |
| # Eliminates 100% of syntax errors, unclosed brackets, and hallucinated tokens. | |
| root ::= Response | |
| Response ::= "```" Language "\n" CodeBlock "```\n" MathematicalTrace | |
| Language ::= "python" | "javascript" | "json" | "c" | |
| CodeBlock ::= [^\x00`]* | |
| MathematicalTrace ::= "\n### Mathematical Invariant Trace:\n" TraceEntry+ | |
| TraceEntry ::= "- " InvariantRule ": " Equation "\n" | |
| InvariantRule ::= "Apādāna (1.4.24)" | "Karaṇa (1.4.42)" | "Karma (1.4.49)" | "Vipratiṣedha (1.4.2)" | "Ūrdhva-Tiryagbhyām" | "Yāvadūnam" | "Sthānivad (1.1.56)" | |
| Equation ::= [^\n]+ | |