diff --git a/bin/build-and-push-model b/bin/build-and-push-model index 670bf66..7c6359e 100755 --- a/bin/build-and-push-model +++ b/bin/build-and-push-model @@ -14,12 +14,14 @@ tag=${3:-latest} annotations="annotation.org.opencontainers.image.revision=${sha},annotation.org.opencontainers.image.source=https://huggingface.co/${name},annotation-index.org.opencontainers.image.revision=${sha},annotation-index.org.opencontainers.image.source=https://huggingface.co/${name},annotation-manifest-descriptor.org.opencontainers.image.revision=${sha},annotation-manifest-descriptor.org.opencontainers.image.source=https://huggingface.co/${name}" +normalized="$(echo "$name" | tr '[:upper:]' '[:lower:]')" + depot build . \ -f "${SCRIPT_DIR}/../models/Dockerfile" \ --platform linux/amd64,linux/arm64 \ --build-arg "MODEL=${name}" \ --build-arg "SHA=${sha}" \ --build-arg "SOURCE_DATE_EPOCH=0" \ - --output "type=image,name=us-docker.pkg.dev/depot-gcp/depot-ai/$(echo "$name" | tr '[:upper:]' '[:lower:]'):${tag},push=true,compression=estargz,oci-mediatypes=true,force-compression=true,${annotations}" \ + --output "type=image,name=us-docker.pkg.dev/depot-gcp/depot-ai/${normalized}:${tag},push=true,compression=estargz,oci-mediatypes=true,force-compression=true,${annotations}" \ --ssh "default=${SSH_AUTH_SOCK}" \ --progress plain diff --git a/website/src/components/Model.tsx b/website/src/components/Model.tsx index 96130ed..83d4a88 100644 --- a/website/src/components/Model.tsx +++ b/website/src/components/Model.tsx @@ -1,5 +1,5 @@ import {cx} from 'class-variance-authority' -import {SVGProps, useCallback, useEffect, useState} from 'react' +import {SVGProps, useCallback, useEffect, useMemo, useState} from 'react' import {useCopyToClipboard} from '../hooks/useCopyToClipboard' export interface ModelProps { @@ -20,9 +20,11 @@ export function Model({name, sha, tagAs}: ModelProps) { return () => clearTimeout(timeout) }, [value]) + const normalizedName = useMemo(() => name.toLowerCase(), [name]) + const copyImage = useCallback(() => { - copy(`COPY --link --from=depot.ai/${name}:${tagAs} / .`) - }, [name, tagAs]) + copy(`COPY --link --from=depot.ai/${normalizedName}:${tagAs} / .`) + }, [normalizedName, tagAs]) return (