Update kaggle_train.py and README.md

This commit is contained in:
Hamza committed 2026-05-17 11:06:12 +02:00
1 parent 99f6f6265b
commit 83f80ab935
2 files changed
+140 -32

No files matched your search

+20 -7
View File
@@ -483,18 +483,31 @@ python kaggle_train.py \
--output_dir runs/classify
```
**One-time setup:**
**One-time setup (pick one option):**
1. Go to [kaggle.com/settings/api](https://www.kaggle.com/settings/api) → **Create New Token** → downloads `kaggle.json`
2. Move it to `~/.kaggle/kaggle.json`
3. On Linux/Mac: `chmod 600 ~/.kaggle/kaggle.json`
**Option A — New token file** *(what Kaggle now issues — recommended)*
Or use environment variables instead of the file:
Go to [kaggle.com/settings/api](https://www.kaggle.com/settings/api) → **Create New Token**.
Kaggle shows you a command to run — paste it directly into your terminal:
```bash
export KAGGLE_USERNAME=your_username
export KAGGLE_KEY=your_api_key
mkdir -p ~/.kaggle && echo YOUR_TOKEN > ~/.kaggle/access_token && chmod 600 ~/.kaggle/access_token
```
**Option B — Environment variable**
```bash
export KAGGLE_API_TOKEN=your_token
```
**Option C — Legacy `kaggle.json`** *(still supported)*
Go to Settings → API → **Create Legacy API Key** → save the file:
```bash
mv ~/Downloads/kaggle.json ~/.kaggle/kaggle.json
chmod 600 ~/.kaggle/kaggle.json # Linux/Mac only
```
The script auto-detects which credential you have — no configuration needed.
**What the script does automatically:**
| Step | Action |