-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from daskol/feature/huggingface
Add integration with HuggingFace's `transformers`
- Loading branch information
Showing
13 changed files
with
300 additions
and
118 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
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,85 @@ | ||
# See PEP-517 and PEP-518 for details. | ||
|
||
[build-system] | ||
requires = ["setuptools", "setuptools_scm[toml]>=7", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "telepyth" | ||
description = "Telegram notifications in Python." | ||
license = {text = "MIT"} | ||
authors = [ | ||
{name = "Daniel Bershatsky", email = "daniel.bershatsky@skolkovotech.ru"}, | ||
] | ||
maintainers = [ | ||
{name = "Daniel Bershatsky", email = "daniel.bershatsky@skolkovotech.ru"}, | ||
] | ||
readme = {file = "README.md", content-type = "text/markdown"} | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Information Technology", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"Natural Language :: English", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Operating System :: MacOS", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
"Topic :: Scientific/Engineering :: Information Analysis", | ||
"Topic :: Software Development", | ||
"Typing :: Typed", | ||
] | ||
dynamic = ["version"] | ||
dependencies = [] | ||
requires-python = ">=3.8,<4" | ||
|
||
[project.optional-dependencies] | ||
magic = ["ipython"] | ||
huggingface = ["transformers"] | ||
|
||
[project.scripts] | ||
telepyth = "telepyth.cli:main" | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/daskol/telepyth" | ||
Repository = "https://github.com/daskol/telepyth.git" | ||
|
||
[tool.isort] | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true | ||
plugins = "numpy.typing.mypy_plugin" | ||
show_column_numbers = true | ||
show_error_codes = true | ||
show_error_context = false | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "7.0" | ||
addopts = "-ra -q -m 'not slow'" | ||
testpaths = ["telepyth"] | ||
markers = [ | ||
"slow: marks tests as slow (deselect with '-m \"not slow\"')", | ||
] | ||
filterwarnings = ["ignore::DeprecationWarning"] | ||
|
||
[tool.setuptools] | ||
include-package-data = false | ||
platforms = ["Linux"] | ||
zip-safe = false | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["telepyth*"] | ||
|
||
[tool.setuptools_scm] | ||
write_to = "telepyth/version.py" | ||
|
||
[tool.yapf] | ||
based_on_style = "pep8" |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
# encoding: utf8 | ||
# __init__.py | ||
"""Package telepyth is a frontend library to telepyth notification service for | ||
Telegram. | ||
""" | ||
|
||
from telepyth.client import TelePythClient | ||
from telepyth.utils import is_interactive | ||
from telepyth.utils import is_huggingface_imported, is_interactive | ||
|
||
|
||
TelepythClient = TelePythClient # make alias to origin definition | ||
TelepythClient = TelePythClient # Alias to match origin definition. | ||
|
||
if is_interactive(): | ||
from telepyth.magics import TelePythMagics | ||
|
||
if is_huggingface_imported(): | ||
from telepyth.integration import TelePythCallback | ||
|
||
__all__ = ('TelePythCallback', 'TelePythClient', 'TelePythMagics', | ||
'TelepythClient') |
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 @@ | ||
from telepyth.integration.huggingface import TelePythCallback |
Oops, something went wrong.