Upload folder using huggingface_hub
Browse files- .gitmodules +4 -0
- OptTf-0.1.6-py3-none-any.whl +0 -0
- README.md +12 -0
- pyproject.toml +19 -0
- requirements.txt +1 -0
- src/edge_maxxing_4090_newdream.egg-info/PKG-INFO +10 -0
- src/edge_maxxing_4090_newdream.egg-info/SOURCES.txt +10 -0
- src/edge_maxxing_4090_newdream.egg-info/dependency_links.txt +1 -0
- src/edge_maxxing_4090_newdream.egg-info/entry_points.txt +2 -0
- src/edge_maxxing_4090_newdream.egg-info/requires.txt +5 -0
- src/edge_maxxing_4090_newdream.egg-info/top_level.txt +2 -0
- src/main.py +50 -0
- src/pipeline.py +3 -0
- src/pyarmor_runtime_000000/__init__.py +2 -0
- src/pyarmor_runtime_000000/pyarmor_runtime.so +0 -0
.gitmodules
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[submodule "newdream-sdxl-20"]
|
| 2 |
+
path = models/newdream-sdxl-20
|
| 3 |
+
url = https://huggingface.co/stablediffusionapi/newdream-sdxl-20
|
| 4 |
+
branch = main
|
OptTf-0.1.6-py3-none-any.whl
ADDED
|
Binary file (191 kB). View file
|
|
|
README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# edge-maxxing-newdream-sdxl
|
| 2 |
+
|
| 3 |
+
This holds the baseline for the SDXL Nvidia GeForce RTX 4090 contest, which can be forked freely and optimized
|
| 4 |
+
|
| 5 |
+
Some recommendations are as follows:
|
| 6 |
+
- Installing dependencies should be done in pyproject.toml, including git dependencies
|
| 7 |
+
- Compiled models should be included directly in the repository(rather than compiling during loading), loading time matters far more than file sizes
|
| 8 |
+
- Avoid changing `src/main.py`, as that includes mostly protocol logic. Most changes should be in `models` and `src/pipeline.py`
|
| 9 |
+
- Change `requirements.txt` to add extra arguments to be used when installing the package
|
| 10 |
+
|
| 11 |
+
For testing, you need a docker container with pytorch and ubuntu 22.04,
|
| 12 |
+
you can download your listed dependencies with `pip install -r requirements.txt -e .`, and then running `start_inference`
|
pyproject.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
requires = ["setuptools >= 61.0"]
|
| 3 |
+
build-backend = "setuptools.build_meta"
|
| 4 |
+
|
| 5 |
+
[project]
|
| 6 |
+
name = "edge-maxxing-4090-newdream"
|
| 7 |
+
description = "An edge-maxxing model submission for the 4090 newdream contest"
|
| 8 |
+
requires-python = ">=3.10,<3.11"
|
| 9 |
+
version = "1.0.0"
|
| 10 |
+
dependencies = [
|
| 11 |
+
"diffusers==0.30.2",
|
| 12 |
+
"transformers==4.41.2",
|
| 13 |
+
"accelerate==0.31.0",
|
| 14 |
+
"omegaconf==2.3.0",
|
| 15 |
+
"edge-maxxing-pipelines @ git+https://github.com/womboai/edge-maxxing#subdirectory=pipelines",
|
| 16 |
+
]
|
| 17 |
+
|
| 18 |
+
[project.scripts]
|
| 19 |
+
start_inference = "main:main"
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
OptTf-0.1.6-py3-none-any.whl
|
src/edge_maxxing_4090_newdream.egg-info/PKG-INFO
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: edge-maxxing-4090-newdream
|
| 3 |
+
Version: 1.0.0
|
| 4 |
+
Summary: An edge-maxxing model submission for the 4090 newdream contest
|
| 5 |
+
Requires-Python: <3.11,>=3.10
|
| 6 |
+
Requires-Dist: diffusers==0.30.2
|
| 7 |
+
Requires-Dist: transformers==4.41.2
|
| 8 |
+
Requires-Dist: accelerate==0.31.0
|
| 9 |
+
Requires-Dist: omegaconf==2.3.0
|
| 10 |
+
Requires-Dist: edge-maxxing-pipelines@ git+https://github.com/womboai/edge-maxxing#subdirectory=pipelines
|
src/edge_maxxing_4090_newdream.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
README.md
|
| 2 |
+
pyproject.toml
|
| 3 |
+
src/main.py
|
| 4 |
+
src/pipeline.py
|
| 5 |
+
src/edge_maxxing_4090_newdream.egg-info/PKG-INFO
|
| 6 |
+
src/edge_maxxing_4090_newdream.egg-info/SOURCES.txt
|
| 7 |
+
src/edge_maxxing_4090_newdream.egg-info/dependency_links.txt
|
| 8 |
+
src/edge_maxxing_4090_newdream.egg-info/entry_points.txt
|
| 9 |
+
src/edge_maxxing_4090_newdream.egg-info/requires.txt
|
| 10 |
+
src/edge_maxxing_4090_newdream.egg-info/top_level.txt
|
src/edge_maxxing_4090_newdream.egg-info/dependency_links.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
|
src/edge_maxxing_4090_newdream.egg-info/entry_points.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[console_scripts]
|
| 2 |
+
start_inference = main:main
|
src/edge_maxxing_4090_newdream.egg-info/requires.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diffusers==0.30.2
|
| 2 |
+
transformers==4.41.2
|
| 3 |
+
accelerate==0.31.0
|
| 4 |
+
omegaconf==2.3.0
|
| 5 |
+
edge-maxxing-pipelines@ git+https://github.com/womboai/edge-maxxing#subdirectory=pipelines
|
src/edge_maxxing_4090_newdream.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
main
|
| 2 |
+
pipeline
|
src/main.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from io import BytesIO
|
| 2 |
+
from multiprocessing.connection import Listener
|
| 3 |
+
from os import chmod, remove
|
| 4 |
+
from os.path import abspath, exists
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
|
| 7 |
+
from PIL.JpegImagePlugin import JpegImageFile
|
| 8 |
+
from pipelines.models import TextToImageRequest
|
| 9 |
+
|
| 10 |
+
from pipeline import load_pipeline, infer
|
| 11 |
+
|
| 12 |
+
SOCKET = abspath(Path(__file__).parent.parent / "inferences.sock")
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def main():
|
| 16 |
+
print(f"Loading pipeline")
|
| 17 |
+
pipeline = load_pipeline()
|
| 18 |
+
|
| 19 |
+
print(f"Pipeline loaded, creating socket at '{SOCKET}'")
|
| 20 |
+
|
| 21 |
+
if exists(SOCKET):
|
| 22 |
+
remove(SOCKET)
|
| 23 |
+
|
| 24 |
+
with Listener(SOCKET) as listener:
|
| 25 |
+
chmod(SOCKET, 0o777)
|
| 26 |
+
|
| 27 |
+
print(f"Awaiting connections")
|
| 28 |
+
with listener.accept() as connection:
|
| 29 |
+
print(f"Connected")
|
| 30 |
+
|
| 31 |
+
while True:
|
| 32 |
+
try:
|
| 33 |
+
request = TextToImageRequest.model_validate_json(connection.recv_bytes().decode("utf-8"))
|
| 34 |
+
except EOFError:
|
| 35 |
+
print(f"Inference socket exiting")
|
| 36 |
+
|
| 37 |
+
return
|
| 38 |
+
|
| 39 |
+
image = infer(request, pipeline)
|
| 40 |
+
|
| 41 |
+
data = BytesIO()
|
| 42 |
+
image.save(data, format=JpegImageFile.format)
|
| 43 |
+
|
| 44 |
+
packet = data.getvalue()
|
| 45 |
+
|
| 46 |
+
connection.send_bytes(packet)
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
if __name__ == '__main__':
|
| 50 |
+
main()
|
src/pipeline.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pyarmor 8.5.11 (trial), 000000, non-profits, 2024-09-17T11:09:13.660522
|
| 2 |
+
from pyarmor_runtime_000000 import __pyarmor__
|
| 3 |
+
__pyarmor__(__name__, __file__, b'PY000000\x00\x03\n\x00o\r\r\n\x80\x00\x01\x00\x08\x00\x00\x00\x04\x00\x00\x00@\x00\x00\x00\xd5\x06\x00\x00\x12\t\x04\x00\xbe\x0eU5e\xe2Y\xce\xb49{\x13\xc3\xb6\xde \x00\x00\x00\x00\x00\x00\x00\x00\xcc\xb2\xa0\x7f\xc8\x8d\xf5u\xed:\xf5\xac\xf6\xe9ww2\x14\x03Y\xbd\xdf\xad\x95[!\xef;\x9c<\xa5"\x84\x8d\xe7v\xd4r$N\xa9\xd6q~=h\x10\xe9\x16F\xf4\x8f\x11m\x0f\xa7{/\xee\xc1\x98ISi<3\xd4\x16U.A\xa6\x89k\x94\xaeJC\xd0\x9b\x96\x81\xa7\xf0\xd8t\x8b[K\x9fPt\x85\x05\x15\xa9\xeeD\xebP\xfd_\xf0G\xf0\xfa\xd3#\xf7\xdf\x9c\x80b\xcaP\x1c\x17\x8a\x82\xc8U\xe2\xc8p\x98#S\x91\x04CD\xd5\x93\x85\xa8\x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\x9c\x19\xc0P\x85%ua\xd4.EL*@@K \xe9\xa3$\x0e\xdf\x9c\xa9\x96\xe7\xe6 \xabj\x08x\xfe\x94F5%[>\xe6\t\x87\xa2\x1c3a|\xa3\xea\x10\xa5L\xc7\xe9\xea\xdd\xd7\xc1\xa3\xab\xf4\xc2\xc3\x15\xcc\x06\x0c\x8a\x86#\x90r\xf3\xc1\xca\xc2')
|
src/pyarmor_runtime_000000/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pyarmor 8.5.11 (trial), 000000, 2024-09-17T11:09:13.658281
|
| 2 |
+
from .pyarmor_runtime import __pyarmor__
|
src/pyarmor_runtime_000000/pyarmor_runtime.so
ADDED
|
Binary file (788 kB). View file
|
|
|