Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit ·
8d76fb2
1
Parent(s): be4f68b
Fix bugs of message disappearing sometimes and being duplicate sometimes
Browse files- CONTRIBUTING.md +86 -0
CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contributing to ml-agent
|
| 2 |
+
|
| 3 |
+
## Creating a Pull Request
|
| 4 |
+
|
| 5 |
+
### 1. Create and work on your branch
|
| 6 |
+
|
| 7 |
+
```bash
|
| 8 |
+
# Create a new branch
|
| 9 |
+
git checkout -b your-feature-branch
|
| 10 |
+
|
| 11 |
+
# Make your changes, then commit
|
| 12 |
+
git add .
|
| 13 |
+
git commit -m "Your commit message"
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
### 2. Push your branch to keep changes backed up
|
| 17 |
+
|
| 18 |
+
```bash
|
| 19 |
+
# First time pushing this branch
|
| 20 |
+
git push --set-upstream origin your-feature-branch
|
| 21 |
+
|
| 22 |
+
# Subsequent pushes
|
| 23 |
+
git push
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
### 3. When ready, create a Pull Request
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
# Easy way: Use the helper script
|
| 30 |
+
./create-pr.sh "Your PR title" "Optional description"
|
| 31 |
+
|
| 32 |
+
# This automatically:
|
| 33 |
+
# - Gets your current branch
|
| 34 |
+
# - Creates the PR
|
| 35 |
+
# - Pushes your changes to it
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
### Example workflow
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
# 1. Create branch
|
| 42 |
+
git checkout -b fix-bug-123
|
| 43 |
+
|
| 44 |
+
# 2. Make changes and commit
|
| 45 |
+
git add backend/main.py
|
| 46 |
+
git commit -m "Fix authentication bug"
|
| 47 |
+
|
| 48 |
+
# 3. Push to keep changes safe
|
| 49 |
+
git push --set-upstream origin fix-bug-123
|
| 50 |
+
|
| 51 |
+
# 4. Continue working...
|
| 52 |
+
git add frontend/src/App.tsx
|
| 53 |
+
git commit -m "Update UI"
|
| 54 |
+
git push
|
| 55 |
+
|
| 56 |
+
# 5. When ready, create PR
|
| 57 |
+
./create-pr.sh "Fix authentication bug" "Fixes issue where users could not authenticate in dev mode"
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
## Development Setup
|
| 61 |
+
|
| 62 |
+
### Running locally with hot-reload
|
| 63 |
+
|
| 64 |
+
**Backend:**
|
| 65 |
+
```bash
|
| 66 |
+
cd backend
|
| 67 |
+
uv run uvicorn main:app --host 0.0.0.0 --port 7860 --reload
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
**Frontend** (in a separate terminal):
|
| 71 |
+
```bash
|
| 72 |
+
cd frontend
|
| 73 |
+
npm run dev
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
Access the app at http://localhost:5173
|
| 77 |
+
|
| 78 |
+
### Environment Variables
|
| 79 |
+
|
| 80 |
+
Make sure your `.env` file in the project root contains:
|
| 81 |
+
```
|
| 82 |
+
ANTHROPIC_API_KEY=your_key_here
|
| 83 |
+
HF_TOKEN=your_hf_token_here
|
| 84 |
+
GITHUB_TOKEN=your_github_token_here
|
| 85 |
+
HF_NAMESPACE=your_namespace_here
|
| 86 |
+
```
|