2022-10-08 04:30:12 -06:00
|
|
|
[tool.poetry]
|
2023-03-07 10:52:22 -07:00
|
|
|
name = "text-generation-server"
|
2023-07-28 09:43:46 -06:00
|
|
|
version = "1.0.0"
|
2023-02-03 04:43:37 -07:00
|
|
|
description = "Text Generation Inference Python gRPC Server"
|
2022-10-08 04:30:12 -06:00
|
|
|
authors = ["Olivier Dehaene <olivier@huggingface.co>"]
|
|
|
|
|
2022-10-17 06:59:00 -06:00
|
|
|
[tool.poetry.scripts]
|
2023-03-07 10:52:22 -07:00
|
|
|
text-generation-server = 'text_generation_server.cli:app'
|
2022-10-17 06:59:00 -06:00
|
|
|
|
2022-10-08 04:30:12 -06:00
|
|
|
[tool.poetry.dependencies]
|
|
|
|
python = "^3.9"
|
|
|
|
protobuf = "^4.21.7"
|
2023-01-05 04:01:23 -07:00
|
|
|
grpcio = "^1.51.1"
|
|
|
|
grpcio-status = "^1.51.1"
|
|
|
|
grpcio-reflection = "^1.51.1"
|
|
|
|
grpc-interceptor = "^0.15.0"
|
2022-10-08 04:30:12 -06:00
|
|
|
typer = "^0.6.1"
|
2023-05-23 10:03:22 -06:00
|
|
|
accelerate = { version = "^0.19.0", optional = true }
|
2023-04-19 11:39:31 -06:00
|
|
|
bitsandbytes = { version = "^0.38.1", optional = true }
|
2023-04-25 05:50:56 -06:00
|
|
|
safetensors = "0.3.1"
|
2023-01-05 04:01:23 -07:00
|
|
|
loguru = "^0.6.0"
|
2023-02-13 05:02:45 -07:00
|
|
|
opentelemetry-api = "^1.15.0"
|
|
|
|
opentelemetry-exporter-otlp = "^1.15.0"
|
|
|
|
opentelemetry-instrumentation-grpc = "^0.36b0"
|
2023-03-03 03:26:27 -07:00
|
|
|
hf-transfer = "^0.1.2"
|
2023-04-11 08:38:22 -06:00
|
|
|
sentencepiece = "^0.1.97"
|
|
|
|
tokenizers = "0.13.3"
|
2023-06-08 06:51:52 -06:00
|
|
|
huggingface-hub = "^0.14.1"
|
2023-07-04 12:23:55 -06:00
|
|
|
transformers = "4.29.2"
|
2023-07-03 05:01:46 -06:00
|
|
|
einops = "^0.6.1"
|
2023-07-27 06:50:45 -06:00
|
|
|
texttable = { version = "^1.6.7", optional = true }
|
|
|
|
datasets = { version = "^2.14.0", optional = true }
|
feat(server): Add native support for PEFT Lora models (#762)
- Will detect `peft` model by finding `adapter_config.json`.
- This triggers a totally dedicated `download-weights` path
- This path, loads the adapter config, finds the base model_id
- It loads the base_model
- Then peft_model
- Then `merge_and_unload()`
- Then `save_pretrained(.., safe_serialization=True)
- Add back the config + tokenizer.merge_and_unload()`
- Then `save_pretrained(.., safe_serialization=True)
- Add back the config + tokenizer.
- The chosen location is a **local folder with the name of the user
chosen model id**
PROs:
- Easier than to expect user to merge manually
- Barely any change outside of `download-weights` command.
- This means everything will work in a single load.
- Should enable out of the box SM + HFE
CONs:
- Creates a local merged model in unusual location, potentially
not saved across docker reloads, or ovewriting some files if the PEFT
itself was local and containing other files in addition to the lora
Alternatives considered:
- Add `local_files_only=True` every where (discard because of massive
code change for not a good enough reason)
- Return something to `launcher` about the new model-id (a cleaner
location for this new model), but it would
introduce new communication somewhere where we didn't need it before.
- Using the HF cache folder and *stopping* the flow after
`download-weights` and asking user to restart with the actual local
model location
Fix #482
# What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet
though.
Once merged, your PR is going to appear in the release notes with the
title you set, so make sure it's a great title that fully reflects the
extent of your awesome contribution.
Then, please replace this with a description of the change and which
issue is fixed (if applicable). Please also include relevant motivation
and context. List any dependencies (if any) that are required for this
change.
Once you're done, someone will review your PR shortly (see the section
"Who can review?" below to tag some potential reviewers). They may
suggest changes to make the code even better. If no one reviewed your PR
after a week has passed, don't hesitate to post a new comment
@-mentioning the same persons---sometimes notifications get lost.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [ ] Did you read the [contributor
guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the
[forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes?
Here are the
[documentation
guidelines](https://github.com/huggingface/transformers/tree/main/docs),
and
[here are tips on formatting
docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have
passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the
right person to tag with @
@OlivierDehaene OR @Narsil
-->
2023-08-03 09:22:45 -06:00
|
|
|
peft = "^0.4.0"
|
2023-08-03 13:54:39 -06:00
|
|
|
torch = {version = "^2.0.1+cu118", source = "pytorch-gpu-src"}
|
2022-10-08 04:30:12 -06:00
|
|
|
|
2022-10-28 11:24:00 -06:00
|
|
|
[tool.poetry.extras]
|
2023-04-19 11:39:31 -06:00
|
|
|
accelerate = ["accelerate"]
|
2022-10-28 11:24:00 -06:00
|
|
|
bnb = ["bitsandbytes"]
|
2023-07-27 06:50:45 -06:00
|
|
|
quantize = ["texttable", "datasets", "accelerate"]
|
2022-10-28 11:24:00 -06:00
|
|
|
|
2022-10-08 04:30:12 -06:00
|
|
|
[tool.poetry.group.dev.dependencies]
|
2023-02-13 05:02:45 -07:00
|
|
|
grpcio-tools = "^1.51.1"
|
2023-04-13 04:43:05 -06:00
|
|
|
pytest = "^7.3.0"
|
2022-10-08 04:30:12 -06:00
|
|
|
|
2023-08-03 13:54:39 -06:00
|
|
|
|
|
|
|
[[tool.poetry.source]]
|
|
|
|
name = "pytorch-gpu-src"
|
|
|
|
url = "https://download.pytorch.org/whl/cu118"
|
|
|
|
priority = "explicit"
|
|
|
|
|
2023-05-22 07:05:32 -06:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
markers = ["private: marks tests as requiring an admin hf token (deselect with '-m \"not private\"')"]
|
|
|
|
|
2022-10-08 04:30:12 -06:00
|
|
|
[build-system]
|
|
|
|
requires = ["poetry-core>=1.0.0"]
|
|
|
|
build-backend = "poetry.core.masonry.api"
|