beerohan commited on
Commit ·
b99dd79
1
Parent(s): 489dcde
Update all files for HuggingFace Spaces (port 7860)
Browse files- studyrag/.env.example +1 -1
- studyrag/README.md +17 -15
- studyrag/docker-compose.yml +3 -3
studyrag/.env.example
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
GROQ_API_KEY=your_groq_api_key_here
|
| 2 |
-
PORT=
|
| 3 |
HOST=0.0.0.0
|
|
|
|
| 1 |
GROQ_API_KEY=your_groq_api_key_here
|
| 2 |
+
PORT=7860
|
| 3 |
HOST=0.0.0.0
|
studyrag/README.md
CHANGED
|
@@ -75,18 +75,18 @@ cp .env.example .env
|
|
| 75 |
Edit `.env` and add your Groq API key:
|
| 76 |
```
|
| 77 |
GROQ_API_KEY=your_groq_api_key_here
|
| 78 |
-
PORT=
|
| 79 |
HOST=0.0.0.0
|
| 80 |
```
|
| 81 |
|
| 82 |
5. **Run the application**
|
| 83 |
```bash
|
| 84 |
-
uvicorn app.main:app --reload
|
| 85 |
```
|
| 86 |
|
| 87 |
6. **Access the application**
|
| 88 |
|
| 89 |
-
Open your browser and navigate to: `http://localhost:
|
| 90 |
|
| 91 |
### Docker Setup
|
| 92 |
|
|
@@ -147,7 +147,7 @@ studyrag/
|
|
| 147 |
|
| 148 |
- `GROQ_API_KEY`: Your Groq API key (required, free tier available)
|
| 149 |
- `HOST`: Server host (default: 0.0.0.0)
|
| 150 |
-
- `PORT`: Server port (default:
|
| 151 |
|
| 152 |
### Application Settings
|
| 153 |
|
|
@@ -157,18 +157,20 @@ Edit `app/config.py` to modify:
|
|
| 157 |
|
| 158 |
## Deployment
|
| 159 |
|
| 160 |
-
### Deploy to
|
| 161 |
|
| 162 |
1. Push code to GitHub
|
| 163 |
-
2. Go to [
|
| 164 |
-
3.
|
| 165 |
-
4.
|
| 166 |
-
|
| 167 |
-
- **
|
| 168 |
-
- **
|
| 169 |
-
|
| 170 |
-
6. Add
|
| 171 |
-
7.
|
|
|
|
|
|
|
| 172 |
|
| 173 |
## Features in Detail
|
| 174 |
|
|
@@ -210,7 +212,7 @@ pip install --upgrade -r requirements.txt
|
|
| 210 |
|
| 211 |
**Port already in use:**
|
| 212 |
```bash
|
| 213 |
-
uvicorn app.main:app --port
|
| 214 |
```
|
| 215 |
|
| 216 |
**File upload fails:**
|
|
|
|
| 75 |
Edit `.env` and add your Groq API key:
|
| 76 |
```
|
| 77 |
GROQ_API_KEY=your_groq_api_key_here
|
| 78 |
+
PORT=7860
|
| 79 |
HOST=0.0.0.0
|
| 80 |
```
|
| 81 |
|
| 82 |
5. **Run the application**
|
| 83 |
```bash
|
| 84 |
+
uvicorn app.main:app --reload --port 7860
|
| 85 |
```
|
| 86 |
|
| 87 |
6. **Access the application**
|
| 88 |
|
| 89 |
+
Open your browser and navigate to: `http://localhost:7860`
|
| 90 |
|
| 91 |
### Docker Setup
|
| 92 |
|
|
|
|
| 147 |
|
| 148 |
- `GROQ_API_KEY`: Your Groq API key (required, free tier available)
|
| 149 |
- `HOST`: Server host (default: 0.0.0.0)
|
| 150 |
+
- `PORT`: Server port (default: 7860)
|
| 151 |
|
| 152 |
### Application Settings
|
| 153 |
|
|
|
|
| 157 |
|
| 158 |
## Deployment
|
| 159 |
|
| 160 |
+
### Deploy to Hugging Face Spaces (Recommended - Free)
|
| 161 |
|
| 162 |
1. Push code to GitHub
|
| 163 |
+
2. Go to [huggingface.co](https://huggingface.co) and create an account
|
| 164 |
+
3. Click your profile → **New Space**
|
| 165 |
+
4. Configure:
|
| 166 |
+
- **Space name**: `studyson`
|
| 167 |
+
- **SDK**: Select **Docker**
|
| 168 |
+
- **Hardware**: CPU basic (free)
|
| 169 |
+
5. Under **Files** → Link to GitHub repo (or upload files)
|
| 170 |
+
6. Add secret: `GROQ_API_KEY` in Space Settings → Variables
|
| 171 |
+
7. The Space will auto-build and deploy!
|
| 172 |
+
|
| 173 |
+
**Your app will be live at:** `https://huggingface.co/spaces/YOUR_USERNAME/studyson`
|
| 174 |
|
| 175 |
## Features in Detail
|
| 176 |
|
|
|
|
| 212 |
|
| 213 |
**Port already in use:**
|
| 214 |
```bash
|
| 215 |
+
uvicorn app.main:app --port 8000
|
| 216 |
```
|
| 217 |
|
| 218 |
**File upload fails:**
|
studyrag/docker-compose.yml
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
version: '3.8'
|
| 2 |
|
| 3 |
services:
|
| 4 |
-
|
| 5 |
build: .
|
| 6 |
ports:
|
| 7 |
-
- "
|
| 8 |
environment:
|
| 9 |
- GROQ_API_KEY=${GROQ_API_KEY}
|
| 10 |
- HOST=0.0.0.0
|
| 11 |
-
- PORT=
|
| 12 |
volumes:
|
| 13 |
- ./uploads:/app/uploads
|
| 14 |
restart: unless-stopped
|
|
|
|
| 1 |
version: '3.8'
|
| 2 |
|
| 3 |
services:
|
| 4 |
+
studyson:
|
| 5 |
build: .
|
| 6 |
ports:
|
| 7 |
+
- "7860:7860"
|
| 8 |
environment:
|
| 9 |
- GROQ_API_KEY=${GROQ_API_KEY}
|
| 10 |
- HOST=0.0.0.0
|
| 11 |
+
- PORT=7860
|
| 12 |
volumes:
|
| 13 |
- ./uploads:/app/uploads
|
| 14 |
restart: unless-stopped
|