hf_text-generation-inference/server
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_kernels Add RoCm support (#1243) 2023-11-27 14:08:12 +01:00
exllama_kernels feat: experimental support for cuda graphs (#1428) 2024-02-12 10:09:29 +01:00
exllamav2_kernels feat: experimental support for cuda graphs (#1428) 2024-02-12 10:09:29 +01:00
tests feat(server): add frequency penalty (#1541) 2024-02-08 18:41:25 +01:00
text_generation_server Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
.gitignore Impl simple mamba model (#1480) 2024-02-08 10:19:45 +01:00
Makefile Impl simple mamba model (#1480) 2024-02-08 10:19:45 +01:00
Makefile-awq feat: experimental support for cuda graphs (#1428) 2024-02-12 10:09:29 +01:00
Makefile-eetq feat: eetq gemv optimization when batch_size <= 4 (#1502) 2024-01-31 12:05:49 +01:00
Makefile-flash-att Add RoCm support (#1243) 2023-11-27 14:08:12 +01:00
Makefile-flash-att-v2 `make install-flash-attn-v2-cuda` should work like `make install-flash-attn-v2` used to work. (#1294) 2023-11-28 16:28:40 +01:00
Makefile-selective-scan Impl simple mamba model (#1480) 2024-02-08 10:19:45 +01:00
Makefile-vllm Speculative (#1308) 2023-12-11 12:46:30 +01:00
README.md feat(router): refactor API and add openAPI schemas (#53) 2023-02-03 12:43:37 +01:00
poetry.lock Update to peft 0.8.2 (#1537) 2024-02-08 12:44:04 +01:00
pyproject.toml Outlines guided generation (#1539) 2024-02-15 10:28:10 +01:00
requirements_common.txt Add RoCm support (#1243) 2023-11-27 14:08:12 +01:00
requirements_cuda.txt v1.4.0 (#1494) 2024-01-26 19:04:57 +01:00
requirements_rocm.txt v1.4.0 (#1494) 2024-01-26 19:04:57 +01:00

README.md

Text Generation Inference Python gRPC Server

A Python gRPC server for Text Generation Inference

Install

make install

Run

make run-dev