Skip to content
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions recipes/tensorflow-text/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -exuo pipefail

export HERMETIC_PYTHON_VERSION=$(${PYTHON} -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")

WHEEL_DIR=${PWD}/wheel_dir
mkdir -p ${WHEEL_DIR}
bazel build ./oss_scripts/pip_package:build_pip_package
bazel-bin/text/oss_scripts/pip_package/build_pip_package ${WHEEL_DIR}
${PYTHON} -m pip install --no-deps ${WHEEL_DIR}/*.whl
bazel clean
61 changes: 61 additions & 0 deletions recipes/tensorflow-text/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{% set version = "2.17.0" %}
{% set tensorflow_version = ".".join(version.split(".")[:2]) %}

package:
name: tensorflow-text
version: {{ version }}

source:
url: https://github.com/tensorflow/text/archive/v{{ version }}.tar.gz
sha256: 55bff24f120024664124c8fdc0ab842ab314bd5ff2791770a80f32bb67cb26d1

build:
number: 0
skip: true # [win]
string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]

requirements:
build:
- {{ compiler('c') }}
- {{ stdlib('c') }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
- bazel >=5.2.0
host:
- python
- pip
- packaging
- setuptools >=70
- wheel
- absl-py
- tensorflow {{ tensorflow_version }}
- tensorflow-base *=cuda* # [cuda_compiler_version != "None"]
- tensorflow-base *=cpu* # [cuda_compiler_version == "None"]
run:
- python
- tensorflow {{ tensorflow_version }}
- tensorflow-base *=cuda* # [cuda_compiler_version != "None"]
- tensorflow-base *=cpu* # [cuda_compiler_version == "None"]

test:
requires:
- pip
- absl-py
- pytest
- tf-keras
- tensorflow-datasets >=3.2.0
commands:
- pip check

about:
home: https://www.tensorflow.org/text/
license: Apache-2.0
license_family: Apache
license_file: LICENSE
summary: TF.Text is a TensorFlow library of text related ops, modules, and subgraphs.
dev_url: https://github.com/tensorflow/text

extra:
recipe-maintainers:
- ehfd
Loading