File size: 3,593 Bytes
d876e1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Deploying SigmaTriple to Hugging Face Spaces

This guide will help you deploy the SigmaTriple application to Hugging Face Spaces.

## Prerequisites

1. A Hugging Face account (sign up at [huggingface.co](https://huggingface.co/join))
2. Git installed on your local machine
3. Hugging Face CLI (optional, for command line deployment)

## Deployment Steps

### Option 1: Using the Hugging Face Web Interface

1. **Create a New Space**:
   - Go to [huggingface.co/spaces](https://huggingface.co/spaces)
   - Click on "Create new Space"
   - Enter a name for your Space (e.g., "SigmaTriple")
   - Select "Streamlit" as the SDK
   - Choose "Public" or "Private" visibility
   - Select "T4" as the Hardware (GPU is recommended for this application)
   - Click "Create Space"

2. **Upload Files**:
   - You can either upload the files directly through the web interface
   - Or clone the Space repository and push the files using Git (recommended)

3. **Git Deployment**:
   ```bash
   # Clone your new Space repository
   git clone https://huggingface.co/spaces/YOUR_USERNAME/SigmaTriple
   
   # Copy all files from this project to the cloned repository
   cp -r * /path/to/cloned/repo/
   cp -r .streamlit /path/to/cloned/repo/
   cp .gitignore /path/to/cloned/repo/
   
   # Navigate to the cloned repository
   cd /path/to/cloned/repo
   
   # Add all files
   git add .
   
   # Commit the changes
   git commit -m "Initial commit of SigmaTriple application"
   
   # Push to Hugging Face Spaces
   git push
   ```

4. **Wait for Deployment**:
   - Hugging Face will automatically build and deploy your Space
   - This may take a few minutes, especially for the first deployment
   - You can monitor the build process in the "Settings" tab of your Space

### Option 2: Using Hugging Face CLI

1. **Install the Hugging Face CLI**:
   ```bash
   pip install huggingface_hub
   ```

2. **Login to Hugging Face**:
   ```bash
   huggingface-cli login
   ```

3. **Create a New Space**:
   ```bash
   huggingface-cli repo create SigmaTriple --type space --sdk streamlit
   ```

4. **Clone and Push**:
   ```bash
   git clone https://huggingface.co/spaces/YOUR_USERNAME/SigmaTriple
   cp -r * /path/to/cloned/repo/
   cp -r .streamlit /path/to/cloned/repo/
   cp .gitignore /path/to/cloned/repo/
   cd /path/to/cloned/repo
   git add .
   git commit -m "Initial commit of SigmaTriple application"
   git push
   ```

## Configuration Options

You can customize your Space by modifying the following files:

- `.streamlit/config.toml`: Streamlit configuration
- `README.md`: Documentation and Space description
- `requirements.txt`: Python dependencies
- `packages.txt`: System dependencies

## Troubleshooting

If you encounter any issues during deployment:

1. **Check the Build Logs**:
   - Go to the "Settings" tab of your Space
   - Look for any error messages in the build logs

2. **Common Issues**:
   - **Memory Errors**: The model requires significant memory. Make sure you're using a GPU instance.
   - **Dependency Issues**: Check that all required packages are listed in requirements.txt and packages.txt.
   - **Timeout Errors**: The initial model loading might take time. Hugging Face Spaces has a build timeout of 10 minutes.

3. **Reduce Model Size**:
   - If you're experiencing memory issues, you can modify app.py to use a smaller model or implement model loading optimizations.

## Accessing Your Space

Once deployed, your Space will be available at:
`https://huggingface.co/spaces/YOUR_USERNAME/SigmaTriple`

You can share this URL with others to let them use your application.