forked from keras-team/keras-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebf79d3
commit e95bca6
Showing
5 changed files
with
127 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -7,7 +7,7 @@ __pycache__/ | |
*.swp | ||
*.swo | ||
|
||
keras_hub.egg-info/ | ||
*.egg-info/ | ||
dist/ | ||
|
||
.coverage | ||
|
This file contains 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
This file contains 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,7 @@ | ||
# KerasNLP: Multi-framework NLP Models | ||
|
||
KerasNLP has renamed to KerasHub! Read the announcement | ||
[here](https://github.com/keras-team/keras-nlp/issues/1831). | ||
|
||
This directory contains a shim package for `keras-nlp` so that the old style | ||
`pip install keras-nlp` and `import keras_nlp` continue to work. |
This file contains 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,41 @@ | ||
# Copyright 2024 The KerasHub Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
import os | ||
|
||
# Import everything from /api/ into keras. | ||
from keras_hub.api import * # noqa: F403 | ||
from keras_hub.api import __version__ # Import * ignores names start with "_". | ||
|
||
# Add everything in /api/ to the module search path. | ||
import keras_hub | ||
__path__.extend(keras_hub.__path__) # noqa: F405 | ||
# Don't pollute namespace. | ||
del keras_hub | ||
del os | ||
|
||
|
||
# Never autocomplete `.src` or `.api` on an imported keras object. | ||
def __dir__(): | ||
keys = dict.fromkeys((globals().keys())) | ||
keys.pop("src") | ||
keys.pop("api") | ||
return list(keys) | ||
|
||
|
||
# Don't import `.src` or `.api` during `from keras import *`. | ||
__all__ = [ | ||
name | ||
for name in globals().keys() | ||
if not (name.startswith("_") or name in ("src", "api")) | ||
] |
This file contains 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,78 @@ | ||
# Copyright 2024 The KerasHub Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Setup script.""" | ||
|
||
import os | ||
import pathlib | ||
|
||
from setuptools import find_packages | ||
from setuptools import setup | ||
|
||
|
||
def read(rel_path): | ||
here = os.path.abspath(os.path.dirname(__file__)) | ||
with open(os.path.join(here, rel_path)) as fp: | ||
return fp.read() | ||
|
||
|
||
def get_version(rel_path): | ||
for line in read(rel_path).splitlines(): | ||
if line.startswith("__version__"): | ||
delim = '"' if '"' in line else "'" | ||
return line.split(delim)[1] | ||
raise RuntimeError("Unable to find version string.") | ||
|
||
|
||
HERE = pathlib.Path(__file__).parent | ||
README = (HERE / "README.md").read_text() | ||
PARENT = HERE.parent | ||
if os.path.exists(PARENT / "keras_hub" / "version_utils.py"): | ||
VERSION = get_version(PARENT / "keras_hub" / "version_utils.py") | ||
else: | ||
VERSION = get_version(PARENT / "keras_hub" / "src" / "version_utils.py") | ||
|
||
setup( | ||
name="keras-nlp", | ||
description=( | ||
"Industry-strength Natural Language Processing extensions for Keras." | ||
), | ||
long_description=README, | ||
long_description_content_type="text/markdown", | ||
version=VERSION, | ||
url="https://github.com/keras-team/keras-nlp", | ||
author="Keras team", | ||
author_email="[email protected]", | ||
license="Apache License 2.0", | ||
install_requires=[ | ||
f"keras-hub=={VERSION}", | ||
], | ||
# Supported Python versions | ||
python_requires=">=3.9", | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Operating System :: Unix", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: MacOS", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Software Development", | ||
], | ||
packages=find_packages(exclude=("*_test.py",)), | ||
) |