Skip to content

Commit

Permalink
Feat/python package (#23)
Browse files Browse the repository at this point in the history
* feat: python package

* chore: specify branch name
  • Loading branch information
thewh1teagle committed Jul 17, 2024
1 parent df2f202 commit 6dc2514
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ group*-shard*
models
final_model
wandb
cert
cert
venv/
nakdimon.egg*
7 changes: 7 additions & 0 deletions examples/usage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pip install git+https://github.com/thewh1teagle/nakdimon@feat/python-package
# wget https://github.com/elazarg/nakdimon/raw/master/models/Nakdimon.h5

import nakdimon

result = nakdimon.predict("Nakdimon.h5", "שלום עולם!")
print(result)
3 changes: 3 additions & 0 deletions nakdimon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .predict import predict

__all__ = ['predict']
4 changes: 2 additions & 2 deletions nakdimon/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import random
import numpy as np

import hebrew
import utils
from nakdimon import hebrew, utils



class CharacterTable:
Expand Down
2 changes: 1 addition & 1 deletion nakdimon/hebrew.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from functools import lru_cache
import re

import utils
from nakdimon import utils


# "rafe" denotes a letter to which it would have been valid to add a diacritic of some category
Expand Down
4 changes: 1 addition & 3 deletions nakdimon/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

import tensorflow as tf

import utils
import dataset
import hebrew
from nakdimon import utils, dataset, hebrew


if tf.config.set_visible_devices([], 'GPU'):
Expand Down
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from setuptools import setup, find_packages

setup(
name='nakdimon',
version='0.1.0',
packages=find_packages(),
install_requires=[
"numpy==1.24.1",
"tensorflow==2.13.0",
"wandb==0.17.0"
],
)

0 comments on commit 6dc2514

Please sign in to comment.