Spaces:
Sleeping
Sleeping
Upload 18 files
Browse filesFiles changed (7)
- Dockerfile+1-1
- README.md+1-1
- app.pyAdded+49
- dataset.csv
- openenv.yaml+1-1
- pre_submission_validate.py+1-1
- pyproject.toml+2-2
12 unmodified lines131415161612 unmodified lines
EXPOSE 8000
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"]CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]82 unmodified lines838485868687888982 unmodified linesRun server locally:
```bash
uvicorn server.app:app --host 0.0.0.0 --port 8000
uvicorn app:app --host 0.0.0.0 --port 8000
```
Run baseline inference:12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849from __future__ import annotations
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path
from openenv.core.env_server.http_server import create_app
from models import SupportAction, SupportObservation
def _load_environment_class():
try:
from server.customer_support_environment import CustomerSupportEnvironment
return CustomerSupportEnvironment
except ModuleNotFoundError:
# Fallback for runtimes where package-style imports are not resolved.
env_file = Path(__file__).resolve().parent / "server" / "customer_support_environment.py"
if not env_file.exists():
raise
spec = spec_from_file_location("customer_support_environment", env_file)
if spec is None or spec.loader is None:
raise RuntimeError("Unable to load customer_support_environment module")
module = module_from_spec(spec)
spec.loader.exec_module(module)
return module.CustomerSupportEnvironment
CustomerSupportEnvironment = _load_environment_class()
app = create_app(
CustomerSupportEnvironment,
SupportAction,
SupportObservation,
env_name="customer_support_benchmark",
max_concurrent_envs=2,
)
def main(host: str = "0.0.0.0", port: int = 8000) -> None:
import uvicorn
uvicorn.run(app, host=host, port=port)
if __name__ == "__main__":
main()1 unmodified line2345561 unmodified linename: customer_support_benchmark
type: space
runtime: fastapi
app: server.app:app
app: app:app
port: 800058 unmodified lines596061626263646558 unmodified lines
def _check_reset_ping(port: int = 8000) -> bool:
python_bin = sys.executable
cmd = [python_bin, "-m", "uvicorn", "server.app:app", "--host", "127.0.0.1", "--port", str(port)]
cmd = [python_bin, "-m", "uvicorn", "app:app", "--host", "127.0.0.1", "--port", str(port)]
proc = subprocess.Popen(
cmd,
cwd=str(ROOT),16 unmodified lines17181920202122232324252616 unmodified lines]
[project.scripts]
server = "server.app:main"
server = "app:main"
[tool.setuptools]
py-modules = ["models", "tasks", "data_loader", "kb", "client", "inference"]
py-modules = ["app", "models", "tasks", "data_loader", "kb", "client", "inference"]
[tool.setuptools.packages.find]
include = ["server", "server.*"]Dockerfile+1-1
README.md+1-1
app.pyAdded+49
dataset.csv
openenv.yaml+1-1
pre_submission_validate.py+1-1
pyproject.toml+2-2