From 81511072c6be1d2c93b029e548d55c46102956f5 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 3 Dec 2024 17:52:00 +0100 Subject: [PATCH] New build. --- .gitea/workflows/build.yaml | 26 ++++++++++++ .gitignore | 5 +++ Makefile | 24 +++++++++++ dist/Rbabel-1.3.37-py3-none-any.whl | Bin 0 -> 3508 bytes dist/rbabel-1.0.0-py3-none-any.whl | Bin 0 -> 3829 bytes dist/rbabel-1.0.0.tar.gz | Bin 0 -> 2956 bytes dist/rbabel-1.3.37-py3-none-any.whl | Bin 0 -> 3789 bytes dist/rbabel-1.3.37.tar.gz | Bin 0 -> 2910 bytes pyproject.toml | 3 ++ setup.cfg | 28 +++++++++++++ src/Rbabel.egg-info/PKG-INFO | 12 ++++++ src/Rbabel.egg-info/SOURCES.txt | 13 ++++++ src/Rbabel.egg-info/dependency_links.txt | 1 + src/Rbabel.egg-info/entry_points.txt | 3 ++ src/Rbabel.egg-info/requires.txt | 3 ++ src/Rbabel.egg-info/top_level.txt | 1 + src/rbabel.egg-info/PKG-INFO | 12 ++++++ src/rbabel.egg-info/SOURCES.txt | 13 ++++++ src/rbabel.egg-info/dependency_links.txt | 1 + src/rbabel.egg-info/entry_points.txt | 4 ++ src/rbabel.egg-info/requires.txt | 3 ++ src/rbabel.egg-info/top_level.txt | 1 + src/rbabel/__init__.py | 9 ++++ src/rbabel/__main__.py | 13 ++++++ src/rbabel/app.py | 50 +++++++++++++++++++++++ src/rbabel/args.py | 35 ++++++++++++++++ src/rbabel/cli.py | 50 +++++++++++++++++++++++ 27 files changed, 310 insertions(+) create mode 100644 .gitea/workflows/build.yaml create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 dist/Rbabel-1.3.37-py3-none-any.whl create mode 100644 dist/rbabel-1.0.0-py3-none-any.whl create mode 100644 dist/rbabel-1.0.0.tar.gz create mode 100644 dist/rbabel-1.3.37-py3-none-any.whl create mode 100644 dist/rbabel-1.3.37.tar.gz create mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100644 src/Rbabel.egg-info/PKG-INFO create mode 100644 src/Rbabel.egg-info/SOURCES.txt create mode 100644 src/Rbabel.egg-info/dependency_links.txt create mode 100644 src/Rbabel.egg-info/entry_points.txt create mode 100644 src/Rbabel.egg-info/requires.txt create mode 100644 src/Rbabel.egg-info/top_level.txt create mode 100644 src/rbabel.egg-info/PKG-INFO create mode 100644 src/rbabel.egg-info/SOURCES.txt create mode 100644 src/rbabel.egg-info/dependency_links.txt create mode 100644 src/rbabel.egg-info/entry_points.txt create mode 100644 src/rbabel.egg-info/requires.txt create mode 100644 src/rbabel.egg-info/top_level.txt create mode 100644 src/rbabel/__init__.py create mode 100644 src/rbabel/__main__.py create mode 100644 src/rbabel/app.py create mode 100644 src/rbabel/args.py create mode 100644 src/rbabel/cli.py diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..48d3cb2 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,26 @@ +name: Build package +run-name: Build package +on: [push] + +jobs: + Build: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Update repo + run: git pull + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + - name: Update apt + run: apt update + - name: Installing system dependencies + run: apt install python3 python3-pip python3-venv make -y + - name: Run Make + run: make + - run: git add . + - run: git config --global user.email "bot@molodetz.com" + - run: git config --global user.name "bot" + - run: git commit -a -m "Automated update of new package." + - run: git push diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a501307 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.vscode +.venv +.history +__pycache__ + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3aa9ff7 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +BIN = ./.venv/bin/ +PYTHON = ./.venv/bin/python +PIP = ./.venv/bin/pip + +all: build + +ensure_env: + -@python3 -m venv .venv + +format: ensure_env + $(PIP) install shed + . $(BIN)/activate && shed + +build: format + $(PIP) install -e . + $(PIP) install build + $(PYTHON) -m build + +serve: ensure_env + $(BIN)rbabel.serve --host=0.0.0.0 --port=3011 --url=wss://flock.molodetz.nl + +bench: ensure_env + $(BIN)rbabel.bench --url=http://localhost:3011/ + diff --git a/dist/Rbabel-1.3.37-py3-none-any.whl b/dist/Rbabel-1.3.37-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..754a056623d353049f5889eaa2aa38f02f1e6d09 GIT binary patch literal 3508 zcmai0c{r5)_Z~YFLqcVzh{24#vc!nSlI&?Pwz140G)80}LPbIn*(xII*FMQw*2%7H zFUImFl$0!?@O`RZFZuQMeV*%F&-MIq-{*Yp>wNBW4E1PeIY1x~BdFp+D2jlp!NmZ7 zwLq`~fw#A_cXWf>*x=l81REQe=M~kMPH>|j+tm-JnytAw?fC^`^@6oo-{&s(+#Yh^ zL}0G>&3Fjw&&W4^WcmAVWhpuhd{;N*(3h%J$5Me?xJn8WeLi)d*s_11k^ui{lYJ?P zSlw=;Bo!_J9Vf$(hty^3GukJ4NTL*Vx??77EjI(8(cohZdXXf^hg9+g?ZzhR-D4|r zy{H~Po_>o`xZyw5FIk47dGDu{48i_O2TmSHd&ixG91SXem48!w~fF-yPB(K$VE(#mk%)2lv$y013_QaREZ znX^JV=CK9yzt2qsUx<=&&JHikMk5tWjWLdoL?^=Jp+~e>{GBX6d^%NdOQ)3BN#z&D zT{(XYYzRpxb#U|DUh@u|8R?JDPrPoh0N0PdVS<@BBi;pdN#;n#glNw6-#x0+u<7D< zUozRYQc^CghD=;4npc4HXEiJy#YQ&EFJa$0+^jjF(N~&h;+jVijePfR zj1pYc#THb@$22y|Jn1^O`aWzt7)C=c4Vz+gKFnSmE;}h7xdQgC6h?}6Au_lU9?B=W zj7VtQ(J*4|h|@h%ap5Vw^P0cgcpZO{nv4>g3+pxfa@CKS6%UnhE1`^`G|aT*b>1n22TZ&2iG!@2WVJ*d}!H6U-#Fh z3~MN@-k0Xlq|>r1u$ChE6v!L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(?4SVme%`sj*kw<;~c zJ=2Gb_^UHLEdID9EMNWlZcTZIps2iC)Ixi2_l@k-JHvFONFQ*^6aDIE9i&3PzD#6V zYRQ1rY^jA>NAA(yL+A0jiz-XKwey6r^j;H=S3X(;ax1=U#+8>rwqkQf z-p{@5eJSR$$YZESMa@C;@B1y#8{eOD;Hfj~7+t%ezw_{)&@AFPU}gPZ zj=q;|ul4<8D+ g=qF`4vGos>Kdi}6j}A~71OfwZ17Kzp@VCGJ0uJ1AYXATM literal 0 HcmV?d00001 diff --git a/dist/rbabel-1.0.0-py3-none-any.whl b/dist/rbabel-1.0.0-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..5630668cb9aa6b6e7219be57e162aa017be97602 GIT binary patch literal 3829 zcmZ`+1yoeu*BwA=fFUHM1!)*sx@3@HV5lL65NQU9A!R^HLZw@fkP=W(kW>&AL1`(e zk&+ao{E5==AN5m|Pu^R1y>-`md*6M}yJw&C^k4+1XaN8K382RGI?@~Y3>Al)HR1*h zZg|>Q+t|B+t*lUPC~qq(5i~|It{d3QK^4BH^!gG#oedjD0xVdQa^?O;Z}Ny8ovQ7v z{ss55It!A`>l8CH^1_5_o^N|VjJr?2*;lg1qiQEeiAwPU`8EOq<=ELS7?NeCIcfFi zrz_C2Lml)&^6{&-7c^y=>v$$q2zd?L-o#!Lhyn7xgx#nEt!1_EoZ8t(ek!prfkpTF zGY^_og7to@w+RnJ?oBC=C*f2d99QpZjdJ^;-Y5omjLy5W$Nb;h+exOL zQqK76;`E9Qx%0%A1IGu>L%O-j88%#>I=d*&F+Pztnvl7*CZJURmC%MG*lU z6ZtC6tCvW@)gKb}NjisLBAp^T+JO&l2SrX2*l~OSz?&EVpg4-ZH5!czeKtbJJxi3T z@r$5_#Vd`Qnu;3JRQCcpThHAv)(?LsDg=*N!SZCfzB`-{OOLRubvAh%Keg0(lR_89r}^oWLrUG&XJ+A3>iTH9(pb5A|J z&uFg~ku1|q?3=akTW=J9t>bk+cqDh3C=_bi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K?=GZBijD{)$>ePRO> zF%5}H*K!!g(fQpKtA20{Z$Q!Kxo+9j8C;i*hfhmz@?Qe(VEnkML%%=%|3AZ@_3y>;LST|AhXlu{eU>#8t^((4TF_pV)uZ(<5v* z;cx8E>iQ@2UsnDLS{NFO%hI3Ao@ngH$&NeVFS6>;0+JKSe)!>WrsJ;li>WYF7H1$Q z$U5#}$4QUd&k^bClS%(FqvMRnUFa8Mbto0^M43N5Ne@Oy^!;@p?ry-D7&rO%+5Z6b C+yI{d literal 0 HcmV?d00001 diff --git a/dist/rbabel-1.0.0.tar.gz b/dist/rbabel-1.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4d17259ca6187194a5590013be7414c4ff29a28f GIT binary patch literal 2956 zcmV;73v=`ziwFo3H&15*|8insVr6VCF)lDJFfMdqascgJd2ide63@TYryv9bvAecx zNj_2oS~M@sZi{W&qQ}Eq6oDYiw5>+hQgRdTV!!*FAthTra&()x?PdrhmdGJF;xWIO zAt@OxqxJNScln%qBQEytCA3wz>bKptJIiZ~H`|tJ?XkK|DzdneeH{@Z{G}=bHwReB>zu)iTui5XmtG|mmZ+7~Y z-LvhEWyAcpI%aQ=b$2=c1<#Y@8Uc7y`VSfmlK&+CN&b`kNBRHew_lqtUj6d=9_D|q z)45XqcTICm{@dL)$p7{(=l=th|EE0nMqchU|I0-dB=LY*hN->sB0gYhY-o!VIY_j3 zvncY!e85iPNf=~Pmhm{}vCo;G2*Le45!%r#pC)3!-pWQRZks&vf)I+8kx!!}Oh!Ea z(}+XuW#IETgDOv7yw~3HKW2g8S@X>tvO&E+JGRl+p7G2VL7D?A&Eo{C%$x7$DP+p| zW!?gw&PT~byv+VA$npX6f@GTK>3TFibH?-a==n@|PuV2Mf5J@Jpw&{`8WnDfs20*1 zK>8FOEB;Z1<#&PqR&NvkZNmSZ;J;PDf79-m9hl{W{0|fV(|IbAPawjLJc+`)#sA*b z_;1<;{@Y*)pq*%TZHw@KC*k987KEc_HqUY%ooS+gL*}rL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q|Dfe2@cgk|o^dBg{8Pf%AdeE2enW%Ro)ymeH Hzr6hyZgc9g literal 0 HcmV?d00001 diff --git a/dist/rbabel-1.3.37.tar.gz b/dist/rbabel-1.3.37.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3afa8a04f02c3f7dd67f4959cc741e2a0e65e19e GIT binary patch literal 2910 zcmV-k3!(HMiwFo$F;8a#|8insVr6VCF)lMMGdC`DVR8WNU3+iaI1N9+g8W6%&u-6_71z&p|*$gk0&;AM>K4ix~<#&_P1OA{eGAKH2Ynn`g5`7%}(F4 zd$!Rv`>_74uG!fm-CeGKM)M@OLjm5G|AUf_`XBW_>VMS#LjS-0?U&Z8*Z+R=`0Kyd z>1@^iU0CeP`rqyu-92LLa{WJ1{eMn#*LQQb^&iTzAc+UW(oOBP8_@xgb3c6@nYZ50Qz(?v z+q?}jUHQpPToykGvV1_?AerWQx|+;iI-~h&@_feJmt+#;Kk-7@pxu_z>J@2KQk(PY z!1@wiEB-;X<=+DTt=>BR+lc==!GEiQ|EAqBJEm?R@;_1hPvG zuy(1*0wdSEqOlKr6*gVuIT6?tHC$SV|LFh!p#Fa!{QoXm0Z$J9g(}y*@#OLS|Lyp1 znq7Ov|L@o~`v1GZ|40P@F0~k(e!z3(^L^ouIy4v z!EA9S!oC>?u|Fsh96#U^YtM!xW1g0Zz=Knkmb;seY zInF>dS}=`ZB&Q{l7X}0P=ZNHjX*pZTOeYg3h{wsLmb(*2Sb@B8{s5iA+ch+V6SV)( z{`)cPKkKk-+qht#p8dzX_P1I8pSSi;LH|7A-1k=Os{ z>HiK)Kh*zEM*rjf@AuRH%lp6mZpXs?U)29$+i`+8$Q?&d=Z~@e@7n*h02}1~uW4BZ z=mN9Xv-=qT-30|vny{RN$z&456QXJAH+|%0fp?t5<6u(P2vA6`X*evhPfq{!;g_b! z7$+=p^WnjM-OW6%OBxwzk^QA;Us4eM0jy_?5D{U7&bVM|fp?3P*bdl#V3aITs$}$I=WCcs=vJ5yN zMbmsbC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j zDyFxMhd0ZkD7@Lqn25{0mEj0tpWccKyW7S^a{M$T=BA;l9ZUO81kV@gWBxI?S7emT zCOMBE-XuPaNj6Pr8A25GRw8sTePq0sU+9Jho&Q(=CKG^1V*as%z0{%dn?0MlQ^nLy zW=uq=1~5#Ep(%>C%0a1Atioi)P4RordPrTv4|LRJfyH5uBINd@4sXG2lfAs z<3CFOqvl8bztI0*|4sPM|NeX5Hu3v!J0bl3JAVHi@gMOY@gMPjGyY$^`S9-e^g_>X z^RL1GyUu@@E8l;$Km*|UkDbu+7yq@z2Y|KBpMuaf-w@T-E{m_WgZL`j%2@qy>Q<)WGp}12@+5V{XAZt%bs+vD{v-Y){ax{YlS+MD z{5Oj8p9}oAtiFZ#zYD^p{{^KbJE4y&e>3D# z+xlld9`Z**9`e^laM2=3.7 +install_requires = + aiohttp + dataset + yura @ git+https://retoor.molodetz.nl/retoor/yura.git@main + +[options.packages.find] +where = src + +[options.entry_points] +console_scripts = + rbabel.serve = rbabel.__main__:main + rbabel.bench = rbabel.cli:cli_bench + rbabel = rbabel.cli:main diff --git a/src/Rbabel.egg-info/PKG-INFO b/src/Rbabel.egg-info/PKG-INFO new file mode 100644 index 0000000..e6be732 --- /dev/null +++ b/src/Rbabel.egg-info/PKG-INFO @@ -0,0 +1,12 @@ +Metadata-Version: 2.1 +Name: Rbabel +Version: 1.3.37 +Summary: English sentence corrector +Author: Retoor +Author-email: retoor@molodetz.nl +License: MIT +Requires-Python: >=3.7 +Description-Content-Type: text/markdown +Requires-Dist: aiohttp +Requires-Dist: dataset +Requires-Dist: yura@ git+https://retoor.molodetz.nl/retoor/yura.git@main diff --git a/src/Rbabel.egg-info/SOURCES.txt b/src/Rbabel.egg-info/SOURCES.txt new file mode 100644 index 0000000..a98f322 --- /dev/null +++ b/src/Rbabel.egg-info/SOURCES.txt @@ -0,0 +1,13 @@ +pyproject.toml +setup.cfg +src/Rbabel.egg-info/PKG-INFO +src/Rbabel.egg-info/SOURCES.txt +src/Rbabel.egg-info/dependency_links.txt +src/Rbabel.egg-info/entry_points.txt +src/Rbabel.egg-info/requires.txt +src/Rbabel.egg-info/top_level.txt +src/rbabel/__init__.py +src/rbabel/__main__.py +src/rbabel/app.py +src/rbabel/args.py +src/rbabel/cli.py \ No newline at end of file diff --git a/src/Rbabel.egg-info/dependency_links.txt b/src/Rbabel.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/Rbabel.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/src/Rbabel.egg-info/entry_points.txt b/src/Rbabel.egg-info/entry_points.txt new file mode 100644 index 0000000..c731308 --- /dev/null +++ b/src/Rbabel.egg-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +rbabel = rbabel.cli:main +rbabel.serve = rbabel.__main__:main diff --git a/src/Rbabel.egg-info/requires.txt b/src/Rbabel.egg-info/requires.txt new file mode 100644 index 0000000..d179af3 --- /dev/null +++ b/src/Rbabel.egg-info/requires.txt @@ -0,0 +1,3 @@ +aiohttp +dataset +yura@ git+https://retoor.molodetz.nl/retoor/yura.git@main diff --git a/src/Rbabel.egg-info/top_level.txt b/src/Rbabel.egg-info/top_level.txt new file mode 100644 index 0000000..08daaf4 --- /dev/null +++ b/src/Rbabel.egg-info/top_level.txt @@ -0,0 +1 @@ +rbabel diff --git a/src/rbabel.egg-info/PKG-INFO b/src/rbabel.egg-info/PKG-INFO new file mode 100644 index 0000000..a0ebe06 --- /dev/null +++ b/src/rbabel.egg-info/PKG-INFO @@ -0,0 +1,12 @@ +Metadata-Version: 2.1 +Name: rbabel +Version: 1.0.0 +Summary: English sentence corrector +Author: Retoor +Author-email: retoor@molodetz.nl +License: MIT +Requires-Python: >=3.7 +Description-Content-Type: text/markdown +Requires-Dist: aiohttp +Requires-Dist: dataset +Requires-Dist: yura@ git+https://retoor.molodetz.nl/retoor/yura.git@main diff --git a/src/rbabel.egg-info/SOURCES.txt b/src/rbabel.egg-info/SOURCES.txt new file mode 100644 index 0000000..eadca91 --- /dev/null +++ b/src/rbabel.egg-info/SOURCES.txt @@ -0,0 +1,13 @@ +pyproject.toml +setup.cfg +src/rbabel/__init__.py +src/rbabel/__main__.py +src/rbabel/app.py +src/rbabel/args.py +src/rbabel/cli.py +src/rbabel.egg-info/PKG-INFO +src/rbabel.egg-info/SOURCES.txt +src/rbabel.egg-info/dependency_links.txt +src/rbabel.egg-info/entry_points.txt +src/rbabel.egg-info/requires.txt +src/rbabel.egg-info/top_level.txt \ No newline at end of file diff --git a/src/rbabel.egg-info/dependency_links.txt b/src/rbabel.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/rbabel.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/src/rbabel.egg-info/entry_points.txt b/src/rbabel.egg-info/entry_points.txt new file mode 100644 index 0000000..be7cc35 --- /dev/null +++ b/src/rbabel.egg-info/entry_points.txt @@ -0,0 +1,4 @@ +[console_scripts] +rbabel = rbabel.cli:main +rbabel.bench = rbabel.cli:cli_bench +rbabel.serve = rbabel.__main__:main diff --git a/src/rbabel.egg-info/requires.txt b/src/rbabel.egg-info/requires.txt new file mode 100644 index 0000000..d179af3 --- /dev/null +++ b/src/rbabel.egg-info/requires.txt @@ -0,0 +1,3 @@ +aiohttp +dataset +yura@ git+https://retoor.molodetz.nl/retoor/yura.git@main diff --git a/src/rbabel.egg-info/top_level.txt b/src/rbabel.egg-info/top_level.txt new file mode 100644 index 0000000..08daaf4 --- /dev/null +++ b/src/rbabel.egg-info/top_level.txt @@ -0,0 +1 @@ +rbabel diff --git a/src/rbabel/__init__.py b/src/rbabel/__init__.py new file mode 100644 index 0000000..7e315cc --- /dev/null +++ b/src/rbabel/__init__.py @@ -0,0 +1,9 @@ +import logging + +logging.basicConfig( + level=logging.DEBUG, + format='%(asctime)s - %(levelname)s - %(message)s', + datefmt='%Y-%m-%d %H:%M:%S' +) + +log = logging.getLogger(__name__) diff --git a/src/rbabel/__main__.py b/src/rbabel/__main__.py new file mode 100644 index 0000000..23d38fd --- /dev/null +++ b/src/rbabel/__main__.py @@ -0,0 +1,13 @@ +from aiohttp import web +from rbabel.app import create_app +from rbabel.args import parse_args + +def main(): + args = parse_args() + app = create_app(args.url) + web.run_app(app,host=args.host,port=args.port) + + +if __name__ == '__main__': + nain() + diff --git a/src/rbabel/app.py b/src/rbabel/app.py new file mode 100644 index 0000000..216f8a2 --- /dev/null +++ b/src/rbabel/app.py @@ -0,0 +1,50 @@ +from aiohttp import web +from yura.client import AsyncClient as LLMClient + +from rbabel import log + +LLM_NAME = "rbabel" +LLM_CONTEXT = "You are an English grammar corrector. You repsond with only the corrected English of by user given prompt and nothing more. Also replace numbers with the word variant." +LLM_MODEL = "gemma2:latest" + +class Application(web.Application): + + + def __init__(self, llm_url=None, llm_name=LLM_NAME, llm_model=LLM_MODEL,llm_context=LLM_CONTEXT, *args, **kwargs): + self.llm_url = llm_url + self.llm_name = llm_name + self.llm_model = LLM_MODEL + self.llm_context = llm_context + super().__init__(*args, **kwargs) + self.on_startup.append(self.create_llm) + self.router.add_post("/", self.optimize_grammar_handler) + + async def create_llm(self, app): + llm_client = LLMClient(self.llm_url) + log.info("Creating LLM named {}.".format(self.llm_name)) + success = await llm_client.create(self.llm_name, self.llm_model, self.llm_context) + assert(success) + log.info("LLM {} created.".format(self.llm_name)) + await llm_client.close() + + async def fix_grammar(self, content): + corrected_content = [] + llm_client = LLMClient(self.llm_url) + token = await llm_client.connect(self.llm_name) + async for chunk in llm_client.chat(token, content): + corrected_content.append(chunk['content']) + await llm_client.close() + return "".join(corrected_content) + + async def optimize_grammar_handler(self,request): + text = await request.json() + assert(type(text) ==str) + corrected = await self.fix_grammar(text) + print("was:",text) + print("became:",corrected) + return web.json_response(corrected,content_type="application/json") + + +def create_app(llm_url): + return Application(llm_url, LLM_NAME, LLM_MODEL, LLM_CONTEXT) + diff --git a/src/rbabel/args.py b/src/rbabel/args.py new file mode 100644 index 0000000..6277288 --- /dev/null +++ b/src/rbabel/args.py @@ -0,0 +1,35 @@ +import argparse + +def parse_args(): + parser = argparse.ArgumentParser( + description="AI enabled English corrector. Only minor improvements." + ) + + parser.add_argument( + '--url', + type=str, + required=False, + default="http://127.0.0.1:3011/", + help='URL of Katya LLM Server.' + ) + + parser.add_argument( + '--host', + type=str, + default="127.0.0.1", + required=False, + help='Host to bind to.' + ) + + + parser.add_argument( + '--port', + type=int, + default=3011, + required=False, + help='Port to bind to.' + ) + + return parser.parse_args() + + diff --git a/src/rbabel/cli.py b/src/rbabel/cli.py new file mode 100644 index 0000000..865c918 --- /dev/null +++ b/src/rbabel/cli.py @@ -0,0 +1,50 @@ +import asyncio +from aiohttp import ClientSession +from rbabel.args import parse_args +import time + + +async def cli_client(url): + + while True: + sentence = input("> ") + async with ClientSession() as session: + async with session.post("http://localhost:8080",json=sentence) as response: + try: + print(await response.json()) + except Exception as ex: + print(ex) + print(await response.text()) + +async def bench(url): + index = 0 + while True: + index += 1 + sentence = "I bougt {} woden shoe".format(index) + time_start = time.time() + async with ClientSession() as session: + async with session.post(url,json=sentence) as response: + try: + print(await response.json()) + except Exception as ex: + print(ex) + print(await response.text()) + time_end = time.time() + print("Duration: {}".format(time_end-time_start)) + + +def cli_bench(): + args = parse_args() + asyncio.run(bench(args.url)) + + +def main(): + args = parse_args() + asyncio.run(cli_client(args.url)) + +if __name__ == '__main__': + main() + + + +