hf_text-generation-inference/docs/source
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
..
basic_tutorials Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
conceptual fixed command line arguments in docs (#1092) 2023-10-03 12:25:45 +02:00
_toctree.yml Add messages api compatibility docs (#1478) 2024-01-24 11:41:28 -05:00
index.md Remove some content from the README in favour of the documentation (#958) 2023-10-09 11:59:06 +02:00
installation.md Added CLI docs (#799) 2023-08-10 15:00:30 +02:00
messages_api.md feat: add ie update to message docs (#1523) 2024-02-02 16:31:11 +01:00
quicktour.md v1.4.0 (#1494) 2024-01-26 19:04:57 +01:00
supported_models.md GPTQ support on ROCm (#1489) 2024-01-26 16:27:44 +01:00