-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
5 changed files
with
23 additions
and
37 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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import uvicorn | ||
from embedding_server import server | ||
from embedding_server.server import app | ||
|
||
if __name__ == "__main__": | ||
uvicorn.run( | ||
server.app, | ||
host="0.0.0.0", | ||
port=8080, | ||
) | ||
uvicorn.run(app,host="0.0.0.0",port=8000) |
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,9 +1,13 @@ | ||
import uvicorn | ||
from server import app | ||
from embedding_server.server import app | ||
|
||
if __name__ == "__main__": | ||
def main(): | ||
uvicorn.run( | ||
app, | ||
host="0.0.0.0", | ||
port=8080, | ||
) | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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 |
---|---|---|
@@ -1,28 +1,3 @@ | ||
from setuptools import setup, find_packages | ||
from setuptools import setup | ||
|
||
VERSION = "0.2.0" | ||
DESCRIPTION = "Embedding Server" | ||
LONG_DESCRIPTION = "Drop in replacement for OpenAI's embedding API. Can be used with official OpenAPI libraries" | ||
|
||
# Setting up | ||
setup( | ||
name="embedding_server", | ||
version=VERSION, | ||
author="Tosh San", | ||
author_email="[email protected]", | ||
description=DESCRIPTION, | ||
long_description=LONG_DESCRIPTION, | ||
packages=find_packages(), | ||
install_requires=["fastapi", "sentence-transformers", "uvicorn"], | ||
keywords=["python", "embeddings", "fastapi", "openai", "pytorch", "transformers"], | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Education", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: Microsoft :: Windows", | ||
], | ||
package_data={'embedding-server': ['bin/server']}, | ||
scripts=['embedding_server/bin/server'] | ||
) | ||
setup() |
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,8 @@ | ||
[Unit] | ||
Description=Embedding Server | ||
After=multi-user.target[Service] | ||
Type=simple | ||
Restart=always | ||
ExecStart=/usr/bin/python3 -m embedding_server | ||
WantedBy=multi-user.target | ||
DynamicUser=yes |