File size: 2,221 Bytes
5c33f00 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | # SPDX-License-Identifier: Apache-2.0
# Python package of EmbeddingGemma 2 on Tenstorrent p150 (changh95/embeddinggemma-2), from the ROOT of the model repo:
# pip install -e . # the Python API
# pip install -e ".[server,test]" # + the HTTP server and the tests
#
# Install it into an environment that already has tt-metal's ttnn (and its torch 2.11.0+cpu): ttnn and torch are NOT
# declared, so pip never replaces the tt-metal build's own torch. The container image installs the same set through
# tt-model.yaml runtime.packages (pinned there to the versions the tests ran with).
#
# This file lives at the repo root ON PURPOSE and must never move into code/ (tt-model copies code/ over /opt/tt-metal
# before the ttnn install in the image build; a code/pyproject.toml would replace tt-metal's own).
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "tt-embgemma"
dynamic = ["version"]
description = "google/embeddinggemma-2 multimodal embeddings (text, image, video, audio) on Tenstorrent Blackhole p150, with a Python API and an OpenAI-compatible HTTP server"
readme = "code/PYTHON.md"
license = "Apache-2.0"
requires-python = ">=3.10"
dependencies = [
"numpy>=1.24.4,<2",
"safetensors",
"huggingface_hub",
"tokenizers",
"pillow",
]
[project.optional-dependencies]
server = ["fastapi", "uvicorn", "pydantic>=2", "orjson"]
audio = ["scipy", "soundfile"]
test = ["pytest", "httpx"]
[project.urls]
"Model card" = "https://huggingface.co/changh95/embeddinggemma-2"
"Weights" = "https://huggingface.co/google/embeddinggemma-2"
[tool.setuptools.dynamic]
version = { attr = "tt_embgemma.__version__" }
[tool.setuptools.packages.find]
where = ["code"]
include = ["tt_embgemma*"]
exclude = ["tt_embgemma.tests*"]
[tool.setuptools.package-data]
"tt_embgemma" = ["samples/*", "licenses/*"]
"tt_embgemma.tt.mk_vattn" = ["kernels/*.cpp", "kernels/*.hpp"] # device kernels, JIT-compiled at start
"tt_embgemma.ttaw" = ["API.md", "VENDORED.json"]
"tt_embgemma.ttaw.ops" = ["kernels/*.cpp", "kernels/*.hpp", "kernels/*.h"]
[tool.pytest.ini_options]
markers = ["device: needs a Tenstorrent chip (skipped on host-only runs)"]
|