Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add bark and AutoGPTQ #871

Merged
merged 9 commits into from Aug 8, 2023
Merged

feat: add bark and AutoGPTQ #871

merged 9 commits into from Aug 8, 2023

Conversation

mudler
Copy link
Owner

@mudler mudler commented Aug 7, 2023

Description

This PR fixes #866 and partially #796

AutoGPTQ

It is a first stab at supporting AutoGPTQ. Note that there are further enhancements that can be done down the line, such as exposing more parameters and a revision branch where to pick the model from - however this is a first take at it laying down the funtamental pieces to make the link between LocalAI and AutoGPTQ using transformers.

Usage

via API endpoint:

curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
     "model": "TheBloke/orca_mini_v2_13b-GPTQ",
     "messages": [{"role": "user", "content": "### System:\nYou are an AI assistant that follows instruction extremely well. Help as much as you can.\n \n### User: \ntell me about AI \n### Response:"}],
     "backend": "autogptq", "model_base_name": "orca_mini_v2_13b-GPTQ-4bit-128g.no-act.order"
}'

Or configure the model in the YAML config file:

name: _your_model_name_
backend: autogptq
model_base_name: "orca_mini_v2_13b-GPTQ-4bit-128g.no-act.order"
parameters:
  model: "TheBloke/orca_mini_v2_13b-GPTQ"
# ...

Caveats:

  • Token stream is not implemented yet, fallbacks to sending everything in the first batch

Bark

curl http://localhost:8080/tts -H "Content-Type: application/json" -d '{         
     "backend": "bark",
     "input":"Hello!"
   }' | aplay

To specify a model ( https://github.com/suno-ai/bark#-voice-presets ) pass it as model:

curl http://localhost:8080/tts -H "Content-Type: application/json" -d '{         
     "backend": "bark",
     "input":"Hello!",
     "model": "v2/en_speaker_1"
   }' | aplay

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

@mudler mudler force-pushed the autogptq branch 4 times, most recently from 4d19bdc to ca853d3 Compare August 7, 2023 21:38
@mudler mudler force-pushed the autogptq branch 3 times, most recently from 63756b7 to 18d9133 Compare August 7, 2023 22:16
@mudler mudler added the enhancement New feature or request label Aug 7, 2023
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler merged commit 5b3fede into master Aug 8, 2023
14 checks passed
@mudler mudler deleted the autogptq branch August 8, 2023 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high prio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: bark
1 participant