Skip to content

Allow for changing shared.settings during model load via API#4431

Closed
brthor wants to merge 1 commit intooobabooga:mainfrom
brthor:api_model_load_settings
Closed

Allow for changing shared.settings during model load via API#4431
brthor wants to merge 1 commit intooobabooga:mainfrom
brthor:api_model_load_settings

Conversation

@brthor
Copy link
Copy Markdown

@brthor brthor commented Oct 31, 2023

Checklist:

Reasoning

Sometimes, when you load a certain lora, you need to be able to change the instruction_template on the fly.

Rather than focus on that specific use case, allow for updating the shared.settings as a whole at the time of model load via the api.

@brthor brthor changed the title Allow for changing settings during model load Allow for changing settings during model load via API Oct 31, 2023
@brthor brthor changed the title Allow for changing settings during model load via API Allow for changing shared.settings during model load via API Oct 31, 2023
@oobabooga
Copy link
Copy Markdown
Owner

The current API will be replaced with an OpenAI-compatible one, and handling instruction templates is an open problem there. In particular, making /v1/chat/completions work properly when different models are loaded. Can you take a look at #4430? PRs to the openai-api branch are welcome.

@oobabooga
Copy link
Copy Markdown
Owner

Seems to be working for the OpenAI API:

  curl -k http://127.0.0.1:5000/v1/internal/model/load \
    -H "Content-Type: application/json" \
    -d '{
      "model_name": "facebook_galactica-125m",
      "args": {
        "load_in_4bit": true
      },
      "settings": {
        "instruction_template": "Alpaca"
      }
    }'

@oobabooga oobabooga closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants