-
Notifications
You must be signed in to change notification settings - Fork 26
Add PaliGemma 2 examples #133
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
Open
alvarobartt
wants to merge
20
commits into
main
Choose a base branch
from
pali-gemma-2-examples
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
69be05a
Add `examples/gke/deploy-paligemma-2-with-tgi` example (WIP)
alvarobartt 8709ae0
Update `examples/gke/deploy-paligemma-2-with-tgi/README.md`
alvarobartt 3902d13
Update `examples/gke/deploy-paligemma-2-with-tgi/README.md`
alvarobartt 7b89298
Comment manifest separator due to `doc-builder` conflicts
alvarobartt a4168b6
Add notes on PaliGemma prompt formatting and inference
alvarobartt 980a217
Update `examples/gke/deploy-paligemma-2-with-tgi/README.md`
alvarobartt 36f995b
Upload images for `examples/gke/deploy-paligemma2-with-tgi`
alvarobartt 2f6abe2
Temporarily skip `---` due to `doc-builder` formatting issues
alvarobartt 5703b35
Remove `---` as it's not rendering nicely
alvarobartt 713588a
Add missing image reference
alvarobartt 4663c4e
Update notes on prompt formatting
alvarobartt 6330d3f
Apply suggestions from code review
alvarobartt 94f89cb
Upload missing `model-gating.png` and update `README.md`
alvarobartt 2012fd9
Add `examples/vertex-ai/pipelines/fine-tune-paligemma-2-with-pytorch`
alvarobartt 7804264
Remove `imgs` and upload those to `documentation-images`
alvarobartt 3b1a7f5
Update `examples/vertex-ai/pipelines/fine-tune-paligemma-2-with-pytorch`
alvarobartt 78123cb
Fix `pipeline-notebook.ipynb` formatting
alvarobartt 63b6158
Rename `pipeline-notebook.ipynb` to `vertex-notebook.ipynb`
alvarobartt 859527f
Run `scripts/internal/update_example_tables.py`
alvarobartt 6c99feb
Merge branch 'main' into pali-gemma-2-examples
alvarobartt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
examples/gke/deploy-paligemma-2-with-tgi/config/deployment.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: tgi | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: tgi | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: tgi | ||
| hf.co/model: google--paligemma2-3b-pt-224 | ||
| hf.co/task: text-generation | ||
| spec: | ||
| containers: | ||
| - name: tgi | ||
| image: "us-central1-docker.pkg.dev/gcp-partnership-412108/deep-learning-images/huggingface-text-generation-inference-gpu.3.0.1" | ||
| # image: "us-docker.pkg.dev/deeplearning-platform-release/gcr.io/huggingface-text-generation-inference-cu124.3-0.ubuntu2204.py311" | ||
| resources: | ||
| requests: | ||
| nvidia.com/gpu: 1 | ||
| limits: | ||
| nvidia.com/gpu: 1 | ||
| env: | ||
| - name: MODEL_ID | ||
| value: google/paligemma2-3b-pt-224 | ||
| - name: NUM_SHARD | ||
| value: "1" | ||
| - name: PORT | ||
| value: "8080" | ||
| - name: HF_TOKEN | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: hf-secret | ||
| key: hf_token | ||
| volumeMounts: | ||
| - mountPath: /dev/shm | ||
| name: dshm | ||
| - mountPath: /tmp | ||
| name: tmp | ||
| volumes: | ||
| - name: dshm | ||
| emptyDir: | ||
| medium: Memory | ||
| sizeLimit: 1Gi | ||
| - name: tmp | ||
| emptyDir: {} | ||
| nodeSelector: | ||
| cloud.google.com/gke-accelerator: nvidia-l4 |
18 changes: 18 additions & 0 deletions
18
examples/gke/deploy-paligemma-2-with-tgi/config/ingress.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: tgi | ||
| # https://cloud.google.com/kubernetes-engine/docs/concepts/ingress | ||
| annotations: | ||
| kubernetes.io/ingress.class: "gce" | ||
| spec: | ||
| rules: | ||
| - http: | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| backend: | ||
| service: | ||
| name: tgi | ||
| port: | ||
| number: 8080 |
12 changes: 12 additions & 0 deletions
12
examples/gke/deploy-paligemma-2-with-tgi/config/service.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: tgi | ||
| spec: | ||
| selector: | ||
| app: tgi | ||
| type: ClusterIP | ||
| ports: | ||
| - protocol: TCP | ||
| port: 8080 | ||
| targetPort: 8080 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
alvarobartt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.