Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- README.md +32 -22
- inference.py +2 -2
- inference_groq.py +4 -4
- openenv.yaml +1 -1
- server/app.py +1 -1
README.md
CHANGED
|
@@ -51,17 +51,28 @@ using SQL queries and Python code.
|
|
| 51 |
|
| 52 |
### Local Development
|
| 53 |
|
|
|
|
| 54 |
```bash
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
# Install dependencies
|
| 56 |
-
pip install
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
TASK_ID=easy python -m server.app
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
TASK_ID=
|
|
|
|
| 65 |
```
|
| 66 |
|
| 67 |
### Docker (Hugging Face Spaces Ready)
|
|
@@ -76,29 +87,28 @@ docker run -p 7860:7860 sql-sandbox:latest
|
|
| 76 |
|
| 77 |
## Baseline Inference
|
| 78 |
|
| 79 |
-
Runs GPT-4o on all three tasks and prints reproducible scores
|
| 80 |
|
| 81 |
-
```
|
| 82 |
-
|
| 83 |
-
|
|
|
|
| 84 |
python inference.py --url http://localhost:7860
|
| 85 |
```
|
| 86 |
|
| 87 |
## Project Structure
|
| 88 |
|
| 89 |
```
|
| 90 |
-
|
| 91 |
-
βββ
|
| 92 |
-
βββ
|
| 93 |
-
βββ
|
| 94 |
-
βββ
|
| 95 |
-
βββ
|
| 96 |
-
βββ inference.py # GPT-4o baseline script
|
| 97 |
βββ README.md # This file
|
|
|
|
|
|
|
| 98 |
βββ server/
|
| 99 |
-
βββ
|
| 100 |
-
|
| 101 |
-
βββ environment.py # Core environment logic + graders
|
| 102 |
-
βββ requirements.txt
|
| 103 |
-
βββ Dockerfile
|
| 104 |
```
|
|
|
|
| 51 |
|
| 52 |
### Local Development
|
| 53 |
|
| 54 |
+
1. **Clone and Install**
|
| 55 |
```bash
|
| 56 |
+
# Clone the repository
|
| 57 |
+
git clone https://github.com/shreyas231219/Meta-Pytorch-Openenv.git
|
| 58 |
+
cd Meta-Pytorch-Openenv
|
| 59 |
+
|
| 60 |
# Install dependencies
|
| 61 |
+
pip install -e .
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
2. **Run the Server**
|
| 65 |
+
The server will default to port **7860**.
|
| 66 |
|
| 67 |
+
**Bash (Linux/macOS):**
|
| 68 |
+
```bash
|
| 69 |
TASK_ID=easy python -m server.app
|
| 70 |
+
```
|
| 71 |
|
| 72 |
+
**PowerShell (Windows):**
|
| 73 |
+
```powershell
|
| 74 |
+
$env:TASK_ID='easy'
|
| 75 |
+
python -m server.app
|
| 76 |
```
|
| 77 |
|
| 78 |
### Docker (Hugging Face Spaces Ready)
|
|
|
|
| 87 |
|
| 88 |
## Baseline Inference
|
| 89 |
|
| 90 |
+
Runs GPT-4o on all three tasks and prints reproducible scores.
|
| 91 |
|
| 92 |
+
```powershell
|
| 93 |
+
# For local testing in PowerShell (Windows)
|
| 94 |
+
$env:HF_TOKEN='sk-...'
|
| 95 |
+
$env:MODEL_NAME='gpt-4o'
|
| 96 |
python inference.py --url http://localhost:7860
|
| 97 |
```
|
| 98 |
|
| 99 |
## Project Structure
|
| 100 |
|
| 101 |
```
|
| 102 |
+
.
|
| 103 |
+
βββ Dockerfile # Root Dockerfile for HF Spaces
|
| 104 |
+
βββ openenv.yaml # OpenEnv manifest (port 7860)
|
| 105 |
+
βββ pyproject.toml # Package dependencies
|
| 106 |
+
βββ inference.py # baseline inference script
|
| 107 |
+
βββ inference_groq.py # groq inference script
|
|
|
|
| 108 |
βββ README.md # This file
|
| 109 |
+
βββ client.py # EnvClient helper
|
| 110 |
+
βββ models.py # Action & Observation models
|
| 111 |
βββ server/
|
| 112 |
+
βββ app.py # FastAPI server entry point
|
| 113 |
+
βββ environment.py # Core environment logic + graders
|
|
|
|
|
|
|
|
|
|
| 114 |
```
|
inference.py
CHANGED
|
@@ -167,8 +167,8 @@ def main():
|
|
| 167 |
)
|
| 168 |
parser.add_argument(
|
| 169 |
"--url",
|
| 170 |
-
default="http://localhost:
|
| 171 |
-
help="Base URL of the running environment server (default: http://localhost:
|
| 172 |
)
|
| 173 |
parser.add_argument(
|
| 174 |
"--max-turns",
|
|
|
|
| 167 |
)
|
| 168 |
parser.add_argument(
|
| 169 |
"--url",
|
| 170 |
+
default="http://localhost:7860",
|
| 171 |
+
help="Base URL of the running environment server (default: http://localhost:7860)",
|
| 172 |
)
|
| 173 |
parser.add_argument(
|
| 174 |
"--max-turns",
|
inference_groq.py
CHANGED
|
@@ -7,8 +7,8 @@ reproducible scores via the OpenEnv WebSocket client.
|
|
| 7 |
Usage:
|
| 8 |
set GROQ_API_KEY=gsk-... # Windows
|
| 9 |
export GROQ_API_KEY=gsk-... # Linux/macOS
|
| 10 |
-
python
|
| 11 |
-
python
|
| 12 |
"""
|
| 13 |
|
| 14 |
import argparse
|
|
@@ -163,8 +163,8 @@ def main():
|
|
| 163 |
)
|
| 164 |
parser.add_argument(
|
| 165 |
"--url",
|
| 166 |
-
default="http://localhost:
|
| 167 |
-
help="Base URL of the running environment server (default: http://localhost:
|
| 168 |
)
|
| 169 |
parser.add_argument(
|
| 170 |
"--max-turns",
|
|
|
|
| 7 |
Usage:
|
| 8 |
set GROQ_API_KEY=gsk-... # Windows
|
| 9 |
export GROQ_API_KEY=gsk-... # Linux/macOS
|
| 10 |
+
python inference_groq.py # local server
|
| 11 |
+
python inference_groq.py --url https://... # remote server
|
| 12 |
"""
|
| 13 |
|
| 14 |
import argparse
|
|
|
|
| 163 |
)
|
| 164 |
parser.add_argument(
|
| 165 |
"--url",
|
| 166 |
+
default="http://localhost:7860",
|
| 167 |
+
help="Base URL of the running environment server (default: http://localhost:7860)",
|
| 168 |
)
|
| 169 |
parser.add_argument(
|
| 170 |
"--max-turns",
|
openenv.yaml
CHANGED
|
@@ -3,7 +3,7 @@ name: sql_sandbox
|
|
| 3 |
type: space
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
-
port:
|
| 7 |
|
| 8 |
description: >
|
| 9 |
SQL/Data Cleaning Sandbox - a real-world OpenEnv environment where AI agents
|
|
|
|
| 3 |
type: space
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
+
port: 7860
|
| 7 |
|
| 8 |
description: >
|
| 9 |
SQL/Data Cleaning Sandbox - a real-world OpenEnv environment where AI agents
|
server/app.py
CHANGED
|
@@ -69,7 +69,7 @@ def main():
|
|
| 69 |
"""
|
| 70 |
import uvicorn
|
| 71 |
|
| 72 |
-
uvicorn.run(app, host="0.0.0.0", port=
|
| 73 |
|
| 74 |
|
| 75 |
if __name__ == "__main__":
|
|
|
|
| 69 |
"""
|
| 70 |
import uvicorn
|
| 71 |
|
| 72 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 73 |
|
| 74 |
|
| 75 |
if __name__ == "__main__":
|