├── .github └── workflows │ ├── pipy_release.yml │ └── test.yml ├── .gitignore ├── .pre-commit-config.yaml ├── LICENSE ├── README.md ├── docs ├── add_new_model_support.md ├── assets │ ├── plots │ │ ├── arithmetic_grammar_viz.png │ │ ├── benchmarking_results.png │ │ └── benchmarking_smoothed.png │ └── screenshots │ │ └── vscode_ebnf_syntax_highlight.png ├── benchmarking.md ├── contribute.md ├── debugging_custom_grammars.md ├── grammar&parser.md ├── json_grammar.md ├── supported_models.yaml └── troubleshoot.md ├── examples ├── accept.py ├── benchmarking │ ├── logs │ │ ├── json.ebnf-_dlabdata1_llama2_hf_Llama-2-7b-hf-cpu-2024:04:24-21:42:09.tsv │ │ ├── json.ebnf-_dlabdata1_llama2_hf_Llama-2-7b-hf-cpu-2024:04:25-16:17:06.tsv │ │ ├── json.ebnf-_dlabdata1_llm_hub_Mistral-7B-v0.1-cpu-2024:04:24-16:14:50.tsv │ │ ├── json.ebnf-_dlabdata1_llm_hub_Mistral-7B-v0.1-cpu-2024:04:25-08:56:57.tsv │ │ ├── json.ebnf-openai-community_gpt2-cpu-2024:04:24-21:08:21.tsv │ │ └── json.ebnf-openai-community_gpt2-cpu-2024:04:25-15:41:59.tsv │ ├── process_benchmarking_logs.ipynb │ ├── run_generation.sh │ └── time_benchmarking.py ├── demo.sh ├── generate_geo_query.py ├── generate_json.py ├── generate_llama_cpp_python.py ├── generate_pddl.py ├── generate_smiles.py ├── grammars │ ├── PDDL │ │ ├── blocks.ebnf │ │ ├── depot.ebnf │ │ ├── depot_typed.ebnf │ │ ├── satellite.ebnf │ │ └── satellite_typed.ebnf │ ├── SMILES │ │ ├── acrylates.ebnf │ │ ├── chain_extenders.ebnf │ │ ├── generic.ebnf │ │ └── isocyanates.ebnf │ ├── animal.ebnf │ ├── arabic.ebnf │ ├── arithmetic.ebnf │ ├── balanced_parentheses.ebnf │ ├── c.ebnf │ ├── cIE.ebnf │ ├── calflow.ebnf │ ├── chess.ebnf │ ├── chinese.ebnf │ ├── custom_json_grammars │ │ ├── README.md │ │ ├── grammars │ │ │ ├── product_catalog.ebnf │ │ │ └── student.ebnf │ │ ├── json_schema_to_grammar.py │ │ └── schemas │ │ │ ├── product_catalog.json │ │ │ └── student.json │ ├── emoji.ebnf │ ├── geo_query.ebnf │ ├── japanese.ebnf │ ├── json.ebnf │ ├── json_arr.ebnf │ ├── json_minimal.ebnf │ ├── korean.ebnf │ ├── overnight.ebnf │ ├── russian.ebnf │ └── unicode │ │ └── emoji_escape.ebnf ├── metrics │ └── run_constrained_decoding_metric.py ├── pipeline_json.py ├── prompts │ └── json.txt └── run_seq2seq_model.py ├── requirements.txt ├── setup.py ├── tests ├── __init__.py ├── json_utils.py ├── test_accept_string │ ├── __init__.py │ ├── test_accept_unicode_bytes.py │ ├── test_calflow.py │ ├── test_decode_utf8.py │ ├── test_geo_query.py │ ├── test_json.py │ ├── test_json_arr.py │ ├── test_overnight.py │ ├── test_pddl.py │ ├── test_smiles.py │ └── test_unicode.py ├── test_accept_token_sequence │ ├── __init__.py │ ├── _test_accept_tokens_mixin.py │ ├── test_deepseek.py │ ├── test_gemma2.py │ ├── test_gpt2.py │ ├── test_llama.py │ ├── test_llama3.py │ ├── test_mistral.py │ ├── test_phi.py │ └── test_t5.py ├── test_cli │ └── test_model_support.py └── test_parsing │ ├── __init__.py │ └── test_parsing.py └── transformers_cfg ├── __init__.py ├── adapters ├── __init__.py └── llama_cpp_python.py ├── cli ├── __init__.py └── cli_main.py ├── generation ├── __init__.py └── logits_process.py ├── grammar_utils.py ├── logging_config.py ├── metrics ├── __init__.py └── metrics.py ├── parser.py ├── recognizer.py ├── token_grammar_recognizer.py ├── tokenization ├── SUPPORTED_TOKENIZERS.py ├── __init__.py ├── byte_trie.py ├── mapping │ ├── ByteProxyMapping.py │ ├── __init__.py │ └── token2byte.py ├── tokenizer.py └── utils.py ├── utf8_utils.py └── utils.py /.github/workflows/pipy_release.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/.github/workflows/pipy_release.yml -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/.github/workflows/test.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/.gitignore -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/.pre-commit-config.yaml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/README.md -------------------------------------------------------------------------------- /docs/add_new_model_support.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/add_new_model_support.md -------------------------------------------------------------------------------- /docs/assets/plots/arithmetic_grammar_viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/assets/plots/arithmetic_grammar_viz.png -------------------------------------------------------------------------------- /docs/assets/plots/benchmarking_results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/assets/plots/benchmarking_results.png -------------------------------------------------------------------------------- /docs/assets/plots/benchmarking_smoothed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/assets/plots/benchmarking_smoothed.png -------------------------------------------------------------------------------- /docs/assets/screenshots/vscode_ebnf_syntax_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/assets/screenshots/vscode_ebnf_syntax_highlight.png -------------------------------------------------------------------------------- /docs/benchmarking.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/benchmarking.md -------------------------------------------------------------------------------- /docs/contribute.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/contribute.md -------------------------------------------------------------------------------- /docs/debugging_custom_grammars.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/debugging_custom_grammars.md -------------------------------------------------------------------------------- /docs/grammar&parser.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/grammar&parser.md -------------------------------------------------------------------------------- /docs/json_grammar.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/json_grammar.md -------------------------------------------------------------------------------- /docs/supported_models.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/supported_models.yaml -------------------------------------------------------------------------------- /docs/troubleshoot.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/docs/troubleshoot.md -------------------------------------------------------------------------------- /examples/accept.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/accept.py -------------------------------------------------------------------------------- /examples/benchmarking/logs/json.ebnf-_dlabdata1_llama2_hf_Llama-2-7b-hf-cpu-2024:04:24-21:42:09.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/logs/json.ebnf-_dlabdata1_llama2_hf_Llama-2-7b-hf-cpu-2024:04:24-21:42:09.tsv -------------------------------------------------------------------------------- /examples/benchmarking/logs/json.ebnf-_dlabdata1_llama2_hf_Llama-2-7b-hf-cpu-2024:04:25-16:17:06.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/logs/json.ebnf-_dlabdata1_llama2_hf_Llama-2-7b-hf-cpu-2024:04:25-16:17:06.tsv -------------------------------------------------------------------------------- /examples/benchmarking/logs/json.ebnf-_dlabdata1_llm_hub_Mistral-7B-v0.1-cpu-2024:04:24-16:14:50.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/logs/json.ebnf-_dlabdata1_llm_hub_Mistral-7B-v0.1-cpu-2024:04:24-16:14:50.tsv -------------------------------------------------------------------------------- /examples/benchmarking/logs/json.ebnf-_dlabdata1_llm_hub_Mistral-7B-v0.1-cpu-2024:04:25-08:56:57.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/logs/json.ebnf-_dlabdata1_llm_hub_Mistral-7B-v0.1-cpu-2024:04:25-08:56:57.tsv -------------------------------------------------------------------------------- /examples/benchmarking/logs/json.ebnf-openai-community_gpt2-cpu-2024:04:24-21:08:21.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/logs/json.ebnf-openai-community_gpt2-cpu-2024:04:24-21:08:21.tsv -------------------------------------------------------------------------------- /examples/benchmarking/logs/json.ebnf-openai-community_gpt2-cpu-2024:04:25-15:41:59.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/logs/json.ebnf-openai-community_gpt2-cpu-2024:04:25-15:41:59.tsv -------------------------------------------------------------------------------- /examples/benchmarking/process_benchmarking_logs.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/process_benchmarking_logs.ipynb -------------------------------------------------------------------------------- /examples/benchmarking/run_generation.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/run_generation.sh -------------------------------------------------------------------------------- /examples/benchmarking/time_benchmarking.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/benchmarking/time_benchmarking.py -------------------------------------------------------------------------------- /examples/demo.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/demo.sh -------------------------------------------------------------------------------- /examples/generate_geo_query.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/generate_geo_query.py -------------------------------------------------------------------------------- /examples/generate_json.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/generate_json.py -------------------------------------------------------------------------------- /examples/generate_llama_cpp_python.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/generate_llama_cpp_python.py -------------------------------------------------------------------------------- /examples/generate_pddl.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/generate_pddl.py -------------------------------------------------------------------------------- /examples/generate_smiles.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/generate_smiles.py -------------------------------------------------------------------------------- /examples/grammars/PDDL/blocks.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/PDDL/blocks.ebnf -------------------------------------------------------------------------------- /examples/grammars/PDDL/depot.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/PDDL/depot.ebnf -------------------------------------------------------------------------------- /examples/grammars/PDDL/depot_typed.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/PDDL/depot_typed.ebnf -------------------------------------------------------------------------------- /examples/grammars/PDDL/satellite.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/PDDL/satellite.ebnf -------------------------------------------------------------------------------- /examples/grammars/PDDL/satellite_typed.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/PDDL/satellite_typed.ebnf -------------------------------------------------------------------------------- /examples/grammars/SMILES/acrylates.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/SMILES/acrylates.ebnf -------------------------------------------------------------------------------- /examples/grammars/SMILES/chain_extenders.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/SMILES/chain_extenders.ebnf -------------------------------------------------------------------------------- /examples/grammars/SMILES/generic.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/SMILES/generic.ebnf -------------------------------------------------------------------------------- /examples/grammars/SMILES/isocyanates.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/SMILES/isocyanates.ebnf -------------------------------------------------------------------------------- /examples/grammars/animal.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/animal.ebnf -------------------------------------------------------------------------------- /examples/grammars/arabic.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/arabic.ebnf -------------------------------------------------------------------------------- /examples/grammars/arithmetic.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/arithmetic.ebnf -------------------------------------------------------------------------------- /examples/grammars/balanced_parentheses.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/balanced_parentheses.ebnf -------------------------------------------------------------------------------- /examples/grammars/c.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/c.ebnf -------------------------------------------------------------------------------- /examples/grammars/cIE.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/cIE.ebnf -------------------------------------------------------------------------------- /examples/grammars/calflow.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/calflow.ebnf -------------------------------------------------------------------------------- /examples/grammars/chess.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/chess.ebnf -------------------------------------------------------------------------------- /examples/grammars/chinese.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/chinese.ebnf -------------------------------------------------------------------------------- /examples/grammars/custom_json_grammars/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/custom_json_grammars/README.md -------------------------------------------------------------------------------- /examples/grammars/custom_json_grammars/grammars/product_catalog.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/custom_json_grammars/grammars/product_catalog.ebnf -------------------------------------------------------------------------------- /examples/grammars/custom_json_grammars/grammars/student.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/custom_json_grammars/grammars/student.ebnf -------------------------------------------------------------------------------- /examples/grammars/custom_json_grammars/json_schema_to_grammar.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/custom_json_grammars/json_schema_to_grammar.py -------------------------------------------------------------------------------- /examples/grammars/custom_json_grammars/schemas/product_catalog.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/custom_json_grammars/schemas/product_catalog.json -------------------------------------------------------------------------------- /examples/grammars/custom_json_grammars/schemas/student.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/custom_json_grammars/schemas/student.json -------------------------------------------------------------------------------- /examples/grammars/emoji.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/emoji.ebnf -------------------------------------------------------------------------------- /examples/grammars/geo_query.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/geo_query.ebnf -------------------------------------------------------------------------------- /examples/grammars/japanese.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/japanese.ebnf -------------------------------------------------------------------------------- /examples/grammars/json.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/json.ebnf -------------------------------------------------------------------------------- /examples/grammars/json_arr.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/json_arr.ebnf -------------------------------------------------------------------------------- /examples/grammars/json_minimal.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/json_minimal.ebnf -------------------------------------------------------------------------------- /examples/grammars/korean.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/korean.ebnf -------------------------------------------------------------------------------- /examples/grammars/overnight.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/overnight.ebnf -------------------------------------------------------------------------------- /examples/grammars/russian.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/russian.ebnf -------------------------------------------------------------------------------- /examples/grammars/unicode/emoji_escape.ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/grammars/unicode/emoji_escape.ebnf -------------------------------------------------------------------------------- /examples/metrics/run_constrained_decoding_metric.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/metrics/run_constrained_decoding_metric.py -------------------------------------------------------------------------------- /examples/pipeline_json.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/pipeline_json.py -------------------------------------------------------------------------------- /examples/prompts/json.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/prompts/json.txt -------------------------------------------------------------------------------- /examples/run_seq2seq_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/examples/run_seq2seq_model.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/requirements.txt -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/setup.py -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/__init__.py -------------------------------------------------------------------------------- /tests/json_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/json_utils.py -------------------------------------------------------------------------------- /tests/test_accept_string/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_accept_string/test_accept_unicode_bytes.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_accept_unicode_bytes.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_calflow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_calflow.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_decode_utf8.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_decode_utf8.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_geo_query.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_geo_query.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_json.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_json.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_json_arr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_json_arr.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_overnight.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_overnight.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_pddl.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_pddl.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_smiles.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_smiles.py -------------------------------------------------------------------------------- /tests/test_accept_string/test_unicode.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_string/test_unicode.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/_test_accept_tokens_mixin.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/_test_accept_tokens_mixin.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/test_deepseek.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/test_deepseek.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/test_gemma2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/test_gemma2.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/test_gpt2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/test_gpt2.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/test_llama.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/test_llama.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/test_llama3.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/test_llama3.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/test_mistral.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/test_mistral.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/test_phi.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/test_phi.py -------------------------------------------------------------------------------- /tests/test_accept_token_sequence/test_t5.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_accept_token_sequence/test_t5.py -------------------------------------------------------------------------------- /tests/test_cli/test_model_support.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_cli/test_model_support.py -------------------------------------------------------------------------------- /tests/test_parsing/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_parsing/test_parsing.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/tests/test_parsing/test_parsing.py -------------------------------------------------------------------------------- /transformers_cfg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/__init__.py -------------------------------------------------------------------------------- /transformers_cfg/adapters/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /transformers_cfg/adapters/llama_cpp_python.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/adapters/llama_cpp_python.py -------------------------------------------------------------------------------- /transformers_cfg/cli/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /transformers_cfg/cli/cli_main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/cli/cli_main.py -------------------------------------------------------------------------------- /transformers_cfg/generation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /transformers_cfg/generation/logits_process.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/generation/logits_process.py -------------------------------------------------------------------------------- /transformers_cfg/grammar_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/grammar_utils.py -------------------------------------------------------------------------------- /transformers_cfg/logging_config.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/logging_config.py -------------------------------------------------------------------------------- /transformers_cfg/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /transformers_cfg/metrics/metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/metrics/metrics.py -------------------------------------------------------------------------------- /transformers_cfg/parser.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/parser.py -------------------------------------------------------------------------------- /transformers_cfg/recognizer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/recognizer.py -------------------------------------------------------------------------------- /transformers_cfg/token_grammar_recognizer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/token_grammar_recognizer.py -------------------------------------------------------------------------------- /transformers_cfg/tokenization/SUPPORTED_TOKENIZERS.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/tokenization/SUPPORTED_TOKENIZERS.py -------------------------------------------------------------------------------- /transformers_cfg/tokenization/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /transformers_cfg/tokenization/byte_trie.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/tokenization/byte_trie.py -------------------------------------------------------------------------------- /transformers_cfg/tokenization/mapping/ByteProxyMapping.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/tokenization/mapping/ByteProxyMapping.py -------------------------------------------------------------------------------- /transformers_cfg/tokenization/mapping/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /transformers_cfg/tokenization/mapping/token2byte.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/tokenization/mapping/token2byte.py -------------------------------------------------------------------------------- /transformers_cfg/tokenization/tokenizer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/tokenization/tokenizer.py -------------------------------------------------------------------------------- /transformers_cfg/tokenization/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/tokenization/utils.py -------------------------------------------------------------------------------- /transformers_cfg/utf8_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/utf8_utils.py -------------------------------------------------------------------------------- /transformers_cfg/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epfl-dlab/transformers-CFG/HEAD/transformers_cfg/utils.py --------------------------------------------------------------------------------