Spaces:
Running
Running
Commit ·
a4c5c93
1
Parent(s): 9d9fff0
all implemented
Browse files- .gitignore +1 -2
- README.md +73 -0
.gitignore
CHANGED
|
@@ -7,8 +7,7 @@ __pycache__/
|
|
| 7 |
*.pyo
|
| 8 |
|
| 9 |
# Large model/data files
|
| 10 |
-
|
| 11 |
-
embeddings/embeddings.npy
|
| 12 |
*.tar.gz
|
| 13 |
*.zip
|
| 14 |
|
|
|
|
| 7 |
*.pyo
|
| 8 |
|
| 9 |
# Large model/data files
|
| 10 |
+
|
|
|
|
| 11 |
*.tar.gz
|
| 12 |
*.zip
|
| 13 |
|
README.md
CHANGED
|
@@ -268,3 +268,76 @@ Cache stats:
|
|
| 268 |
|
| 269 |
---
|
| 270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
|
| 269 |
---
|
| 270 |
|
| 271 |
+
Deployement STEP :
|
| 272 |
+
|
| 273 |
+
|
| 274 |
+
Step 1: Prepare the Hugging Face Space
|
| 275 |
+
Log in to your Hugging Face account and create a New Space.
|
| 276 |
+
|
| 277 |
+
Name it (e.g., Semantic-Search).
|
| 278 |
+
|
| 279 |
+
Select Docker as the Space SDK and choose the Blank template.
|
| 280 |
+
|
| 281 |
+
Click Create Space.
|
| 282 |
+
|
| 283 |
+
Step 2: Configure Your Project Files
|
| 284 |
+
Before touching Git, ensure your core configuration files are ready for Hugging Face's environment.
|
| 285 |
+
|
| 286 |
+
1. Update Dockerfile
|
| 287 |
+
Hugging Face requires your app to run on port 7860. Ensure your final command looks like this:
|
| 288 |
+
|
| 289 |
+
Dockerfile
|
| 290 |
+
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 291 |
+
2. Update README.md
|
| 292 |
+
Add the required YAML configuration block to the very top of your README.md file (starting on line 1):
|
| 293 |
+
|
| 294 |
+
YAML
|
| 295 |
+
---
|
| 296 |
+
title: Smart Semantic Search
|
| 297 |
+
emoji: 🔍
|
| 298 |
+
colorFrom: blue
|
| 299 |
+
colorTo: indigo
|
| 300 |
+
sdk: docker
|
| 301 |
+
pinned: false
|
| 302 |
+
---
|
| 303 |
+
3. Check Ignore Files
|
| 304 |
+
Ensure that embeddings/chroma_db/ is not listed in your .gitignore or .dockerignore files, so the pre-built database can be uploaded.
|
| 305 |
+
|
| 306 |
+
Step 3: Initialize Git and Git LFS
|
| 307 |
+
Open your terminal in the root directory of your project (where the Dockerfile is) and run these commands to set up Git Large File Storage for all your models, datasets, and hidden database files.
|
| 308 |
+
|
| 309 |
+
Bash
|
| 310 |
+
# Initialize Git and LFS
|
| 311 |
+
git init
|
| 312 |
+
git lfs install
|
| 313 |
+
|
| 314 |
+
# Track standard ML files
|
| 315 |
+
git lfs track "*.npy"
|
| 316 |
+
git lfs track "*.joblib"
|
| 317 |
+
git lfs track "*.sqlite3"
|
| 318 |
+
git lfs track "*.tar.gz"
|
| 319 |
+
git lfs track "*.json"
|
| 320 |
+
|
| 321 |
+
# Track hidden ChromaDB files
|
| 322 |
+
git lfs track "*.bin"
|
| 323 |
+
git lfs track "*.pickle"
|
| 324 |
+
Step 4: Commit and Push
|
| 325 |
+
Now, commit your code and push it to your Hugging Face Space using an Access Token as your password.
|
| 326 |
+
|
| 327 |
+
Bash
|
| 328 |
+
# 1. Commit the LFS tracking rules first
|
| 329 |
+
git add .gitattributes
|
| 330 |
+
git commit -m "Setup Git LFS rules"
|
| 331 |
+
|
| 332 |
+
# 2. Add and commit the rest of your application code
|
| 333 |
+
git add .
|
| 334 |
+
git commit -m "Add application code and models"
|
| 335 |
+
|
| 336 |
+
# 3. Rename branch to 'main' (if it defaulted to master)
|
| 337 |
+
git branch -M main
|
| 338 |
+
|
| 339 |
+
# 4. Link your local repository to Hugging Face
|
| 340 |
+
git remote add huggingface https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
|
| 341 |
+
|
| 342 |
+
# 5. Push to Hugging Face
|
| 343 |
+
git push -u huggingface main
|