Rthur2003 Claude Sonnet 4.6 commited on
Commit
a676b27
·
1 Parent(s): c1db98e

docs: update README with model hub deployment steps and new env vars

Browse files
Files changed (1) hide show
  1. README.md +49 -19
README.md CHANGED
@@ -15,25 +15,51 @@ YouTube-first backend service for AI music detection workflows.
15
 
16
  ## Hugging Face Spaces Deployment
17
 
18
- ### Quick Deploy
19
-
20
- 1. **Hugging Face Space Olustur**
21
- - [huggingface.co/new-space](https://huggingface.co/new-space) adresine git
22
- - Space Name: `crowncode-backend`
23
- - SDK: **Docker** (onemli!)
24
- - Hardware: **CPU Basic (Free)**
25
-
26
- 2. **Dosyalari Yukle**
27
- - Space sayfasinda "Files" sekmesine git
28
- - "Add file" > "Upload files" tikla
29
- - Su dosyalari yukle:
30
- - `Dockerfile`
31
- - `requirements.txt`
32
- - `app/` klasoru (tum icerigi ile)
33
-
34
- 3. **Deploy**
35
- - "Commit changes" butonuna bas
36
- - 3-5 dakika icinde build tamamlanir
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  ### URL Format
39
  ```
@@ -135,6 +161,10 @@ Response:
135
 
136
  | Variable | Default | Description |
137
  |----------|---------|-------------|
 
 
 
 
138
  | `CROWNCODE_CORS_ORIGINS` | `http://localhost:3000` | Allowed CORS origins (comma-separated). **Do not use `*` in production.** |
139
  | `MUSIC_AI_API_URL` | - | Music-AIDetector service URL |
140
  | `SES_ANALIZI_API_URL` | - | Ses-Analizi service URL |
 
15
 
16
  ## Hugging Face Spaces Deployment
17
 
18
+ ### Adım 0 — Model Dosyalarını HF Hub'a Yükle (tek seferlik)
19
+
20
+ Model dosyaları `.gitignore`'da — Space'e gönderilmez. Bunun yerine container
21
+ başlangıcında `startup.py` onları `Rtur2003/auris-models` hub reposundan indirir.
22
+
23
+ ```bash
24
+ # Lokal makinede bir kere çalıştır:
25
+ huggingface-cli login # HF token ister (write izni gerekli)
26
+ python upload_models_to_hub.py # ~415 MB yükler (RF 47MB + wav2vec2 360MB dahil)
27
+ ```
28
+
29
+ Upload sonrası `https://huggingface.co/Rtur2003/auris-models` adresinde
30
+ tüm model dosyaları görünmeli.
31
+
32
+ ### Adım 1 — Space Oluştur
33
+
34
+ - [huggingface.co/new-space](https://huggingface.co/new-space) adresine git
35
+ - Space Name: `crowncode-backend`
36
+ - SDK: **Docker** (önemli!)
37
+ - Hardware: **CPU Basic (Free)**
38
+
39
+ ### Adım 2 — Kodu Push Et
40
+
41
+ ```bash
42
+ cd hf-crowncode-backend
43
+ git remote add space https://huggingface.co/spaces/Rtur2003/crowncode-backend
44
+ git push space main
45
+ ```
46
+
47
+ Veya Space sayfasında "Files" > "Add file" ile `Dockerfile`, `requirements.txt`,
48
+ `startup.py`, `app/` klasörünü yükle.
49
+
50
+ ### Adım 3 — HF_TOKEN Secret Ekle (isteğe bağlı)
51
+
52
+ Eğer `auris-models` reposu **private** ise:
53
+
54
+ - Space > Settings > Repository secrets
55
+ - `HF_TOKEN` = HuggingFace read token
56
+
57
+ ### Adım 4 — Deploy
58
+
59
+ - "Commit changes" butonuna bas
60
+ - Build ~5-8 dk sürer (PyTorch + model download)
61
+ - `startup.py` tüm model dosyalarını `/app/models/` altına indirir
62
+ - API ayağa kalkar, "Önizleme Modu" biter
63
 
64
  ### URL Format
65
  ```
 
161
 
162
  | Variable | Default | Description |
163
  |----------|---------|-------------|
164
+ | `AURIS_MODELS_REPO` | `Rtur2003/auris-models` | HuggingFace model repo to download artifacts from at startup |
165
+ | `MODELS_DIR` | `/app/models` | Local directory where model files are stored |
166
+ | `HF_TOKEN` | - | HuggingFace token (required if `auris-models` repo is private) |
167
+ | `SKIP_MODEL_DOWNLOAD` | `0` | Set to `1` to skip startup download (local dev with models already present) |
168
  | `CROWNCODE_CORS_ORIGINS` | `http://localhost:3000` | Allowed CORS origins (comma-separated). **Do not use `*` in production.** |
169
  | `MUSIC_AI_API_URL` | - | Music-AIDetector service URL |
170
  | `SES_ANALIZI_API_URL` | - | Ses-Analizi service URL |