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

Add LoRA adapters support for Gemma2 #2567

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Add LoRA adapters support for Gemma2 #2567

merged 2 commits into from
Sep 26, 2024

Conversation

alvarobartt
Copy link
Member

@alvarobartt alvarobartt commented Sep 25, 2024

What does this PR do?

This PR adds support for LoRA adapters for Gemma2.

It has been tested with both text-generation-launcher and from a pre-built container.

export HF_TOKEN=$(cat ~/.cache/huggingface/token)
text-generation-launcher \
    --model-id=google/gemma-2-9b-it \
    --lora-adapters=google-cloud-partnership/gemma-2-9b-it-lora-magicoder \
    --num-shard=4 \
    --max-input-length=4000 \
    --max-total-tokens=4096

And requests sent via cURL as:

curl localhost:8080/v1/chat/completions \
    -X POST \
    -H 'Content-Type: application/json' \
    -d '{"messages": [{"role": "user", "content": "Write a function to combine a base path and relative path into an absolute path."}], "max_tokens": 256, "model": "google-cloud-partnership/gemma-2-9b-it-lora-magicoder"}}'

cc'ing @Jofthomas for visibility

Who can review?

@Narsil

Narsil
Narsil previously approved these changes Sep 25, 2024
Copy link
Collaborator

@Narsil Narsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

We really need to abstract away that thing.

@Narsil
Copy link
Collaborator

Narsil commented Sep 26, 2024

Unrelated failures.

@Narsil Narsil merged commit 0b7df77 into main Sep 26, 2024
11 of 12 checks passed
@Narsil Narsil deleted the add-lora-support-gemma2 branch September 26, 2024 08:54
yuanwu2017 pushed a commit to yuanwu2017/tgi-gaudi that referenced this pull request Oct 27, 2024
* Add LoRA adapters support for Gemma2

* Make `black` formatting happy
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