# Push This Project to Your Hugging Face Space Replace `YOUR_USERNAME` and `YOUR_SPACE_NAME` with your actual HF username and Space name (e.g. `skumar54` and `Notebooklm`). ## Prerequisites 1. **Git** installed. 2. **Hugging Face access token** with **write** permission: https://huggingface.co/settings/tokens → Create new token → Role: **Write**. --- ## Option A: Push from this folder (recommended) Run these in **PowerShell** from the project root (`notebooklm__clone`). ### 1. Initialize Git (if not already) ```powershell cd c:\Users\shail\Downloads\notebooklm__clone git init ``` ### 2. Add the Space as a remote Replace `YOUR_USERNAME`, `YOUR_SPACE_NAME`, and `YOUR_HF_TOKEN` with your values. ```powershell git remote add space https://YOUR_USERNAME:YOUR_HF_TOKEN@huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME ``` ### 3. Add all files, commit, and push ```powershell git add . git commit -m "NotebookLM clone: Gradio app, backend, Gemini artifacts" git branch -M main git push space main --force ``` Use `--force` because the Space already has a default `app.py`; you are replacing it with this project. --- ## Option B: Clone the Space, then copy this project into it ### 1. Clone your Space (use token when asked for password) ```powershell cd c:\Users\shail\Downloads git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME YOUR_SPACE_FOLDER cd YOUR_SPACE_FOLDER ``` When prompted for **password**, paste your Hugging Face **access token** (not your account password). ### 2. Copy this project’s files into the clone From `notebooklm__clone`, copy everything **except** `.git` into the cloned folder (overwrite existing files like `app.py`). In PowerShell: ```powershell cd c:\Users\shail\Downloads Copy-Item -Path "notebooklm__clone\*" -Destination "YOUR_SPACE_FOLDER\" -Recurse -Force # Remove .git from copy if it was copied Remove-Item -Path "YOUR_SPACE_FOLDER\.git" -Recurse -Force -ErrorAction SilentlyContinue # The space folder already has .git from clone cd YOUR_SPACE_FOLDER git add . git status git commit -m "NotebookLM clone: full app with Gemini artifacts" git push ``` --- ## After pushing 1. Open **https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME** and wait for the Space to build (1–3 minutes). 2. **Add Secrets** (required for artifacts and optional for chat): - **Settings → Repository secrets** (or **Variables and secrets**): - **`GEMINI_API_KEY`** = your Gemini API key (from https://aistudio.google.com/apikey) - Optional: **`HF_TOKEN`** for chat/embeddings - Optional: **`MOCK_USER`** if you want a default username when not using HF login 3. Restart the Space if you add secrets after the first run. --- ## If push asks for username/password - **Username:** your Hugging Face username - **Password:** your **Hugging Face access token** (with Write role), not your account password. Using the remote URL with the token (Option A, step 2) avoids typing the password each time. Or use `huggingface-cli login` and push without token in the URL.