Aman Khare commited on
Commit ·
6892a94
1
Parent(s): 85cb432
variable changes
Browse files- README.md +3 -3
- inference.py +7 -7
README.md
CHANGED
|
@@ -92,7 +92,7 @@ value = clamp(weighted_sum − deductions, 0.0, 1.0)
|
|
| 92 |
### Prerequisites
|
| 93 |
|
| 94 |
- Python 3.11+
|
| 95 |
-
- An OpenAI-compatible API key (set as `
|
| 96 |
|
| 97 |
### Local Setup
|
| 98 |
|
|
@@ -142,7 +142,7 @@ In another terminal, run the baseline inference script which will interact with
|
|
| 142 |
|
| 143 |
**On Linux/macOS:**
|
| 144 |
```bash
|
| 145 |
-
export
|
| 146 |
export MODEL_NAME="gpt-4o-mini" # or any OpenAI-compatible model
|
| 147 |
export API_BASE_URL="https://api.openai.com/v1"
|
| 148 |
python inference.py
|
|
@@ -150,7 +150,7 @@ python inference.py
|
|
| 150 |
|
| 151 |
**On Windows (PowerShell):**
|
| 152 |
```powershell
|
| 153 |
-
$env:
|
| 154 |
$env:MODEL_NAME="gpt-4o-mini"
|
| 155 |
$env:API_BASE_URL="https://api.openai.com/v1"
|
| 156 |
python inference.py
|
|
|
|
| 92 |
### Prerequisites
|
| 93 |
|
| 94 |
- Python 3.11+
|
| 95 |
+
- An OpenAI-compatible API key (set as `HF_TOKEN`)
|
| 96 |
|
| 97 |
### Local Setup
|
| 98 |
|
|
|
|
| 142 |
|
| 143 |
**On Linux/macOS:**
|
| 144 |
```bash
|
| 145 |
+
export HF_TOKEN="sk-..."
|
| 146 |
export MODEL_NAME="gpt-4o-mini" # or any OpenAI-compatible model
|
| 147 |
export API_BASE_URL="https://api.openai.com/v1"
|
| 148 |
python inference.py
|
|
|
|
| 150 |
|
| 151 |
**On Windows (PowerShell):**
|
| 152 |
```powershell
|
| 153 |
+
$env:HF_TOKEN="sk-..."
|
| 154 |
$env:MODEL_NAME="gpt-4o-mini"
|
| 155 |
$env:API_BASE_URL="https://api.openai.com/v1"
|
| 156 |
python inference.py
|
inference.py
CHANGED
|
@@ -70,10 +70,10 @@
|
|
| 70 |
# Config
|
| 71 |
# ---------------------------------------------------------------------------
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
API_BASE_URL
|
| 76 |
-
MODEL_NAME
|
| 77 |
|
| 78 |
BENCHMARK = "clinical-note-scribe"
|
| 79 |
TASK_IDS = list(TASK_REGISTRY.keys())
|
|
@@ -279,15 +279,15 @@ def run_task(client: OpenAI, env: ClinicalNoteScribeEnv, task_id: str) -> dict[s
|
|
| 279 |
# ---------------------------------------------------------------------------
|
| 280 |
|
| 281 |
def main() -> None:
|
| 282 |
-
if not
|
| 283 |
print(
|
| 284 |
-
"[DEBUG] WARNING: HF_TOKEN
|
| 285 |
"Model calls will fail unless the endpoint requires no auth.",
|
| 286 |
file=sys.stderr,
|
| 287 |
flush=True,
|
| 288 |
)
|
| 289 |
|
| 290 |
-
client = OpenAI(base_url=API_BASE_URL, api_key=
|
| 291 |
env = ClinicalNoteScribeEnv()
|
| 292 |
results: List[dict[str, Any]] = []
|
| 293 |
|
|
|
|
| 70 |
# Config
|
| 71 |
# ---------------------------------------------------------------------------
|
| 72 |
|
| 73 |
+
LOCAL_IMAGE_NAME = os.getenv("LOCAL_IMAGE_NAME")
|
| 74 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 75 |
+
API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
|
| 76 |
+
MODEL_NAME = os.getenv("MODEL_NAME", "Qwen/Qwen2.5-72B-Instruct")
|
| 77 |
|
| 78 |
BENCHMARK = "clinical-note-scribe"
|
| 79 |
TASK_IDS = list(TASK_REGISTRY.keys())
|
|
|
|
| 279 |
# ---------------------------------------------------------------------------
|
| 280 |
|
| 281 |
def main() -> None:
|
| 282 |
+
if not HF_TOKEN:
|
| 283 |
print(
|
| 284 |
+
"[DEBUG] WARNING: HF_TOKEN is not set. "
|
| 285 |
"Model calls will fail unless the endpoint requires no auth.",
|
| 286 |
file=sys.stderr,
|
| 287 |
flush=True,
|
| 288 |
)
|
| 289 |
|
| 290 |
+
client = OpenAI(base_url=API_BASE_URL, api_key=HF_TOKEN)
|
| 291 |
env = ClinicalNoteScribeEnv()
|
| 292 |
results: List[dict[str, Any]] = []
|
| 293 |
|