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 lines1314151612 unmodified linesEXPOSE 8000CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"]12 unmodified lines1314151612 unmodified linesEXPOSE 8000CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
82 unmodified lines8384858687888982 unmodified linesRun server locally:```bashuvicorn server.app:app --host 0.0.0.0 --port 8000```Run baseline inference:82 unmodified lines8384858687888982 unmodified linesRun server locally:```bashuvicorn 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 line234561 unmodified linename: customer_support_benchmarktype: spaceruntime: fastapiapp: server.app:appport: 80001 unmodified line234561 unmodified linename: customer_support_benchmarktype: spaceruntime: fastapiapp: app:appport: 8000
58 unmodified lines5960616263646558 unmodified linesdef _check_reset_ping(port: int = 8000) -> bool:python_bin = sys.executablecmd = [python_bin, "-m", "uvicorn", "server.app:app", "--host", "127.0.0.1", "--port", str(port)]proc = subprocess.Popen(cmd,cwd=str(ROOT),58 unmodified lines5960616263646558 unmodified linesdef _check_reset_ping(port: int = 8000) -> bool:python_bin = sys.executablecmd = [python_bin, "-m", "uvicorn", "app:app", "--host", "127.0.0.1", "--port", str(port)]proc = subprocess.Popen(cmd,cwd=str(ROOT),
16 unmodified lines1718192021222324252616 unmodified lines][project.scripts]server = "server.app:main"[tool.setuptools]py-modules = ["models", "tasks", "data_loader", "kb", "client", "inference"][tool.setuptools.packages.find]include = ["server", "server.*"]16 unmodified lines1718192021222324252616 unmodified lines][project.scripts]server = "app:main"[tool.setuptools]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