Download server/app.py from utkarshsinha/openenv-customer-support: direct link, hf CLI and curl.
- Browser
- Download file 906 Bytes
-
https://huggingface.co/spaces/utkarshsinha/openenv-customer-support/resolve/main/server/app.py
- Command line
-
hf download hf://spaces/utkarshsinha/openenv-customer-support/server/app.py
-
curl -L -o app.py https://huggingface.co/spaces/utkarshsinha/openenv-customer-support/resolve/main/server/app.py
906 Bytes
| import os | |
| try: | |
| from openenv.core.env_server.http_server import create_app | |
| except ImportError as e: | |
| raise ImportError("openenv is required for the web interface.") from e | |
| # Ensure relative imports resolve correctly based on execution context | |
| try: | |
| from models import CustomerSupportAction, CustomerSupportObservation | |
| except ImportError: | |
| from ..models import CustomerSupportAction, CustomerSupportObservation | |
| from .environment import CustomerSupportEnvironment | |
| MAX_CONCURRENT_ENVS = int(os.getenv("MAX_CONCURRENT_ENVS", "100")) | |
| app = create_app( | |
| CustomerSupportEnvironment, | |
| CustomerSupportAction, | |
| CustomerSupportObservation, | |
| env_name="customer_support", | |
| max_concurrent_envs=MAX_CONCURRENT_ENVS, | |
| ) | |
| def main(host: str = "0.0.0.0", port: int = 8000): | |
| import uvicorn | |
| uvicorn.run("server.app:app", host=host, port=int(port)) | |
| if __name__ == "__main__": | |
| main() | |