Huong commited on
Commit
45d1690
·
1 Parent(s): a38e9d5

new DEPLOYMENT.md

Browse files
Files changed (1) hide show
  1. DEPLOYMENT.md +51 -0
DEPLOYMENT.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Deployment Instructions
2
+
3
+ ## Environment Variables
4
+
5
+ This application requires the following environment variables:
6
+
7
+ ### GITHUB_TOKEN
8
+ - **Purpose**: Access to private GitHub repository `huongngo-8/olmoasr`
9
+ - **Required permissions**: `repo` (for private repository access)
10
+ - **How to get**: Go to [GitHub Settings > Personal Access Tokens](https://github.com/settings/tokens)
11
+
12
+ ## Local Development
13
+
14
+ 1. Create a `.env` file in the project root:
15
+ ```bash
16
+ GITHUB_TOKEN=your_github_token_here
17
+ ```
18
+
19
+ 2. Load environment variables:
20
+ ```bash
21
+ export $(cat .env | xargs)
22
+ ```
23
+
24
+ 3. Run the application:
25
+ ```bash
26
+ python app.py
27
+ ```
28
+
29
+ ## HuggingFace Spaces Deployment
30
+
31
+ 1. **Create your Space** on HuggingFace
32
+ 2. **Add Repository Secret**:
33
+ - Go to your Space's settings
34
+ - Navigate to "Repository secrets" or "Variables and secrets"
35
+ - Add `GITHUB_TOKEN` with your GitHub Personal Access Token value
36
+ 3. **Deploy your code** - the `install_dependencies.py` script will automatically handle private repository installation
37
+
38
+ ## How It Works
39
+
40
+ - `requirements.txt` contains only public dependencies
41
+ - `install_dependencies.py` handles private repository installation using environment variables
42
+ - `app.py` calls the installation script at startup
43
+ - No sensitive tokens are stored in version control
44
+
45
+ ## Troubleshooting
46
+
47
+ If you see "Warning: GITHUB_TOKEN environment variable not found":
48
+ 1. Verify the environment variable is set correctly
49
+ 2. Check that your token has `repo` permissions
50
+ 3. Ensure the token hasn't expired
51
+ 4. Verify you have access to the `huongngo-8/olmoasr` repository