hf_text-generation-inference/server/text_generation_server/models
drbh cef0553d59
Outlines guided generation (#1539)
This WIP PR starts to add grammar support via outlines, currently this
PR supports very simple regex grammars and does not optimize for
precompiling or caching grammar fsm's.

todo:
- [X] add simple outlines guidance to `NextTokenChooser`
- [X] update protos for grammar
- [X] update generation params API
- [X] constrain simple grammar
- [ ] support parsing more complex grammar into fsm
- [ ] support all outline support grammar types
- [ ] explore optimizations to avoid recompiling grammars

guided request
```bash
curl -s 'http://localhost:3000/generate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "inputs": "make an email for david: \n",
    "parameters": {
        "max_new_tokens": 6,
        "grammar": "[\\w-]+@([\\w-]+\\.)+[\\w-]+"
    }
}' | jq
```
response
```json
{
  "generated_text": "david@example.com"
}
```

unguided request
```bash
curl -s 'http://localhost:3000/generate' \
--header 'Content-Type: application/json' \
--data '{
    "inputs": "make an email for david: \n",
    "parameters": {
        "max_new_tokens": 6
    }
}' | jq
```
response
```json
{
  "generated_text": "    email = 'david"
}
```
2024-02-15 10:28:10 +01:00
..
custom_modeling Improving mamba runtime by using updates (#1552) 2024-02-14 09:54:10 +01:00
__init__.py feat(server): add frequency penalty (#1541) 2024-02-08 18:41:25 +01:00
bloom.py fix: fix gpt-q params loading 2023-12-14 11:02:16 +01:00
cache_manager.py feat: add mistral model (#1071) 2023-09-28 09:55:47 +02:00
causal_lm.py Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
flash_causal_lm.py Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
flash_llama.py v1.4.0 (#1494) 2024-01-26 19:04:57 +01:00
flash_mistral.py Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
flash_mixtral.py chore: formatting 2023-12-11 14:49:52 +01:00
flash_neox.py fix: fix gpt-q params loading 2023-12-14 11:02:16 +01:00
flash_phi.py v1.4.0 (#1494) 2024-01-26 19:04:57 +01:00
flash_rw.py fix: fix gpt-q params loading 2023-12-14 11:02:16 +01:00
flash_santacoder.py fix: fix gpt-q params loading 2023-12-14 11:02:16 +01:00
galactica.py Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
globals.py Small cleanup. (#1560) 2024-02-14 15:30:07 +01:00
gpt_neox.py fix: fix gpt-q params loading 2023-12-14 11:02:16 +01:00
idefics.py enable bfloat16 for cpu (#1034) 2023-09-19 17:19:28 +02:00
idefics_causal_lm.py Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
mamba.py Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
model.py fix: fix logic if sliding window key is not present in config (#1352) 2023-12-15 14:56:17 +01:00
mpt.py fix: fix gpt-q params loading 2023-12-14 11:02:16 +01:00
opt.py fix: fix gpt-q params loading 2023-12-14 11:02:16 +01:00
phi.py v1.4.0 (#1494) 2024-01-26 19:04:57 +01:00
rw.py enable bfloat16 for cpu (#1034) 2023-09-19 17:19:28 +02:00
santacoder.py enable bfloat16 for cpu (#1034) 2023-09-19 17:19:28 +02:00
seq2seq_lm.py Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
t5.py enable bfloat16 for cpu (#1034) 2023-09-19 17:19:28 +02:00
types.py feat(server): add frequency penalty (#1541) 2024-02-08 18:41:25 +01:00