Spaces:
Sleeping
Sleeping
Naman Gupta commited on
Commit ·
2cbf425
1
Parent(s): 746a5b2
Fix multi-mode deployment issues
Browse files- pyproject.toml +4 -0
- server/app.py +9 -0
pyproject.toml
CHANGED
|
@@ -20,8 +20,12 @@ dependencies = [
|
|
| 20 |
"tenacity>=8.2.0",
|
| 21 |
"openai>=1.12.0",
|
| 22 |
"PyYAML>=6.0.0",
|
|
|
|
| 23 |
]
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
[project.optional-dependencies]
|
| 26 |
dev = [
|
| 27 |
"pytest>=7.4.0",
|
|
|
|
| 20 |
"tenacity>=8.2.0",
|
| 21 |
"openai>=1.12.0",
|
| 22 |
"PyYAML>=6.0.0",
|
| 23 |
+
"openenv-core>=0.2.0",
|
| 24 |
]
|
| 25 |
|
| 26 |
+
[project.scripts]
|
| 27 |
+
server = "server.app:main"
|
| 28 |
+
|
| 29 |
[project.optional-dependencies]
|
| 30 |
dev = [
|
| 31 |
"pytest>=7.4.0",
|
server/app.py
CHANGED
|
@@ -98,3 +98,12 @@ async def auto_attack(request: AutoAttackRequest):
|
|
| 98 |
raise HTTPException(status_code=400, detail="No active episode.")
|
| 99 |
framing = generate_automated_attack(request.strategy_type.value, request.target_category.value)
|
| 100 |
return {"framing": framing}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
raise HTTPException(status_code=400, detail="No active episode.")
|
| 99 |
framing = generate_automated_attack(request.strategy_type.value, request.target_category.value)
|
| 100 |
return {"framing": framing}
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
def main():
|
| 104 |
+
import uvicorn
|
| 105 |
+
uvicorn.run("server.app:app", host="0.0.0.0", port=7860, reload=False)
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
if __name__ == "__main__":
|
| 109 |
+
main()
|