Spaces:
Sleeping
Sleeping
Commit ·
4af042e
1
Parent(s): e67a147
Update .gitattributes and remove workflow documentation
Browse files- .gitattributes +20 -35
- GIT_WORKFLOW.md +0 -130
.gitattributes
CHANGED
|
@@ -1,35 +1,20 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
*.
|
| 6 |
-
*.
|
| 7 |
-
*.
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
*.
|
| 11 |
-
*.
|
| 12 |
-
*.
|
| 13 |
-
*.
|
| 14 |
-
*.
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
*.
|
| 18 |
-
*.
|
| 19 |
-
*.
|
| 20 |
-
*.
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 1 |
+
# Git attributes for OBD Logger
|
| 2 |
+
# This file controls how git handles different file types
|
| 3 |
+
|
| 4 |
+
# Large files that should be excluded from HF Space pushes
|
| 5 |
+
logs/**/*.csv filter=exclude-hf
|
| 6 |
+
*.csv filter=exclude-hf if=size>10MB
|
| 7 |
+
model/**/*.pkl filter=exclude-hf if=size>5MB
|
| 8 |
+
|
| 9 |
+
# Text files
|
| 10 |
+
*.py text
|
| 11 |
+
*.md text
|
| 12 |
+
*.txt text
|
| 13 |
+
*.json text
|
| 14 |
+
*.sh text
|
| 15 |
+
|
| 16 |
+
# Binary files
|
| 17 |
+
*.pkl binary
|
| 18 |
+
*.png binary
|
| 19 |
+
*.jpg binary
|
| 20 |
+
*.jpeg binary
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GIT_WORKFLOW.md
DELETED
|
@@ -1,130 +0,0 @@
|
|
| 1 |
-
# Git Workflow for OBD Logger
|
| 2 |
-
|
| 3 |
-
This document explains how to properly manage the OBD Logger repository with both Hugging Face Space and GitHub.
|
| 4 |
-
|
| 5 |
-
## 🏗️ Repository Structure
|
| 6 |
-
|
| 7 |
-
- **Hugging Face Space**: `https://huggingface.co/spaces/BinKhoaLe1812/OBD_Logger`
|
| 8 |
-
- **GitHub Repository**: `https://github.com/benty691/EAT40005.git` (obd-logger branch)
|
| 9 |
-
|
| 10 |
-
## 📋 Setup (One-time)
|
| 11 |
-
|
| 12 |
-
The repository is already configured with the correct remotes:
|
| 13 |
-
|
| 14 |
-
```bash
|
| 15 |
-
# Check remotes
|
| 16 |
-
git remote -v
|
| 17 |
-
|
| 18 |
-
# Should show:
|
| 19 |
-
# hf https://huggingface.co/spaces/BinKhoaLe1812/OBD_Logger (fetch)
|
| 20 |
-
# hf https://huggingface.co/spaces/BinKhoaLe1812/OBD_Logger (push)
|
| 21 |
-
# origin https://github.com/benty691/EAT40005.git (fetch)
|
| 22 |
-
# origin https://github.com/benty691/EAT40005.git (push)
|
| 23 |
-
```
|
| 24 |
-
|
| 25 |
-
## 🚀 Daily Workflow
|
| 26 |
-
|
| 27 |
-
### Option 1: Using the Script (Recommended)
|
| 28 |
-
|
| 29 |
-
```bash
|
| 30 |
-
# Make changes to your code
|
| 31 |
-
# ... edit files ...
|
| 32 |
-
|
| 33 |
-
# Stage and commit changes
|
| 34 |
-
git add .
|
| 35 |
-
git commit -m "Your commit message"
|
| 36 |
-
|
| 37 |
-
# Push to Hugging Face Space
|
| 38 |
-
./push_workflow.sh hf
|
| 39 |
-
|
| 40 |
-
# Push to GitHub
|
| 41 |
-
./push_workflow.sh github
|
| 42 |
-
|
| 43 |
-
# Or push to both at once
|
| 44 |
-
./push_workflow.sh both
|
| 45 |
-
```
|
| 46 |
-
|
| 47 |
-
### Option 2: Manual Commands
|
| 48 |
-
|
| 49 |
-
```bash
|
| 50 |
-
# Make changes to your code
|
| 51 |
-
# ... edit files ...
|
| 52 |
-
|
| 53 |
-
# Stage and commit changes
|
| 54 |
-
git add .
|
| 55 |
-
git commit -m "Your commit message"
|
| 56 |
-
|
| 57 |
-
# Push to Hugging Face Space (for deployment)
|
| 58 |
-
git push hf main
|
| 59 |
-
|
| 60 |
-
# Push to GitHub (for backup/collaboration)
|
| 61 |
-
git push origin obd-logger
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
-
## 📁 Directory Structure
|
| 65 |
-
|
| 66 |
-
```
|
| 67 |
-
OBD_Logger/
|
| 68 |
-
├── app.py # FastAPI application
|
| 69 |
-
├── Dockerfile # Docker configuration
|
| 70 |
-
├── requirements.txt # Python dependencies
|
| 71 |
-
├── train/ # RLHF training system
|
| 72 |
-
│ ├── rlhf.py # Main RLHF trainer
|
| 73 |
-
│ ├── loader.py # Data loader
|
| 74 |
-
│ └── saver.py # Model saver
|
| 75 |
-
├── utils/ # Utilities
|
| 76 |
-
│ └── download.py # Model downloader
|
| 77 |
-
├── data/ # Data handlers
|
| 78 |
-
├── static/ # Web interface
|
| 79 |
-
└── push_workflow.sh # Push workflow script
|
| 80 |
-
```
|
| 81 |
-
|
| 82 |
-
## 🔄 Workflow Summary
|
| 83 |
-
|
| 84 |
-
1. **Development**: Make changes in the OBD_Logger directory
|
| 85 |
-
2. **Commit**: `git add . && git commit -m "message"`
|
| 86 |
-
3. **Deploy**: `git push hf main` (pushes to Hugging Face Space)
|
| 87 |
-
4. **Backup**: `git push origin obd-logger` (pushes to GitHub)
|
| 88 |
-
|
| 89 |
-
## 🛡️ Security Features
|
| 90 |
-
|
| 91 |
-
- ✅ No hardcoded tokens in code
|
| 92 |
-
- ✅ Models download at runtime
|
| 93 |
-
- ✅ Environment variables loaded from `.env`
|
| 94 |
-
- ✅ Large files excluded from repository
|
| 95 |
-
- ✅ Clean git history
|
| 96 |
-
|
| 97 |
-
## 📊 Monitoring
|
| 98 |
-
|
| 99 |
-
- **Hugging Face Space**: Check deployment status at the HF Space URL
|
| 100 |
-
- **Model Status**: Use `GET /models/status` endpoint to check if models are loaded
|
| 101 |
-
- **Health Check**: Use `GET /health` endpoint for basic health check
|
| 102 |
-
|
| 103 |
-
## 🚨 Troubleshooting
|
| 104 |
-
|
| 105 |
-
### Large File Errors
|
| 106 |
-
If you get large file errors:
|
| 107 |
-
```bash
|
| 108 |
-
# Check for large files
|
| 109 |
-
find . -type f -size +10M
|
| 110 |
-
|
| 111 |
-
# Remove large files from git history
|
| 112 |
-
git filter-branch --tree-filter 'rm -f path/to/large/file' HEAD
|
| 113 |
-
```
|
| 114 |
-
|
| 115 |
-
### Push Failures
|
| 116 |
-
If push fails:
|
| 117 |
-
```bash
|
| 118 |
-
# Check remote configuration
|
| 119 |
-
git remote -v
|
| 120 |
-
|
| 121 |
-
# Force push if needed (be careful!)
|
| 122 |
-
git push hf main --force
|
| 123 |
-
```
|
| 124 |
-
|
| 125 |
-
## 📝 Notes
|
| 126 |
-
|
| 127 |
-
- The OBD_Logger directory is now a clean, independent git repository
|
| 128 |
-
- No large files in the git history
|
| 129 |
-
- Models are downloaded at runtime, not during build
|
| 130 |
-
- Both Hugging Face Space and GitHub are properly configured
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|