Upload folder using huggingface_hub
Browse files- Dockerfile +1 -0
- README.md +1 -0
- pyproject.toml +3 -0
- server/app.py +10 -34
Dockerfile
CHANGED
|
@@ -16,4 +16,5 @@ COPY . .
|
|
| 16 |
|
| 17 |
EXPOSE 7860
|
| 18 |
|
|
|
|
| 19 |
CMD ["uvicorn", "inference:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 16 |
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
+
ENV ENABLE_WEB_INTERFACE=true
|
| 20 |
CMD ["uvicorn", "inference:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -5,6 +5,7 @@ colorFrom: indigo
|
|
| 5 |
colorTo: purple
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
# OpenEnv Data Cleaner
|
|
|
|
| 5 |
colorTo: purple
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
base_path: /web
|
| 9 |
---
|
| 10 |
|
| 11 |
# OpenEnv Data Cleaner
|
pyproject.toml
CHANGED
|
@@ -13,6 +13,9 @@ dependencies = [
|
|
| 13 |
"huggingface_hub",
|
| 14 |
]
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
[build-system]
|
| 17 |
requires = ["setuptools>=61.0"]
|
| 18 |
build-backend = "setuptools.build_meta"
|
|
|
|
| 13 |
"huggingface_hub",
|
| 14 |
]
|
| 15 |
|
| 16 |
+
[project.scripts]
|
| 17 |
+
server = "server.app:main"
|
| 18 |
+
|
| 19 |
[build-system]
|
| 20 |
requires = ["setuptools>=61.0"]
|
| 21 |
build-backend = "setuptools.build_meta"
|
server/app.py
CHANGED
|
@@ -1,45 +1,21 @@
|
|
| 1 |
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
| 2 |
-
# All rights reserved.
|
| 3 |
-
#
|
| 4 |
-
# This source code is licensed under the BSD-style license found in the
|
| 5 |
-
# LICENSE file in the root directory of this source tree.
|
| 6 |
-
|
| 7 |
"""
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
This module creates an HTTP server that exposes the EnvEnvironment
|
| 11 |
-
over HTTP and WebSocket endpoints, compatible with EnvClient.
|
| 12 |
"""
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
except Exception as e:
|
| 17 |
-
raise ImportError(
|
| 18 |
-
"openenv is required for the web interface. Install dependencies with 'uv sync'"
|
| 19 |
-
) from e
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
|
| 23 |
-
from server.env_environment import EnvEnvironment
|
| 24 |
|
|
|
|
| 25 |
|
| 26 |
-
# Create the app with web interface and README integration
|
| 27 |
-
app = create_app(
|
| 28 |
-
EnvEnvironment,
|
| 29 |
-
EnvAction,
|
| 30 |
-
EnvObservation,
|
| 31 |
-
env_name="env",
|
| 32 |
-
max_concurrent_envs=1,
|
| 33 |
-
)
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
"""
|
| 38 |
-
Entry point for direct execution via uv run or python -m.
|
| 39 |
-
"""
|
| 40 |
import uvicorn
|
| 41 |
-
|
| 42 |
-
uvicorn.run(app, host=host, port=port)
|
| 43 |
|
| 44 |
|
| 45 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
"""
|
| 2 |
+
Server entry point for OpenEnv Data Cleaner.
|
| 3 |
+
Imports and re-exports the main app for multi-mode deployment.
|
|
|
|
|
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
+
import sys
|
| 7 |
+
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# Add parent directory to path
|
| 10 |
+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
| 11 |
|
| 12 |
+
from app import app
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
def main():
|
| 16 |
+
"""Entry point for the server script."""
|
|
|
|
|
|
|
|
|
|
| 17 |
import uvicorn
|
| 18 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
if __name__ == "__main__":
|