File size: 1,948 Bytes
29d41e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87132f1
29d41e1
87132f1
29d41e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87132f1
29d41e1
 
 
 
 
 
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
# Hugging Face Spaces Setup Guide

## Quick Deployment to Hugging Face Spaces

### 1. Create a New Space
1. Go to [Hugging Face Spaces](https://huggingface.co/spaces)
2. Click "Create new Space"
3. Choose:
   - **Space name**: `business-card-extractor`
   - **License**: `mit`
   - **Space SDK**: `gradio`
   - **Visibility**: `public` or `private`

### 2. Upload Files
Upload these files to your space:
```
app.py
requirements.txt
prompts/prompt.txt
prompts/system_prompt.txt
README.md
business_cards/.gitkeep
```

**Note**: The `business_cards/` and `business_card_exports/` directories will be created automatically.

### 3. Set Environment Variables
1. Go to your Space **Settings**
2. Scroll to **Repository secrets**
3. Click **Add a new secret**
4. Set:
   - **Name**: `Gemini_API`
   - **Value**: Your AI API key

### 4. Get Your AI API Key
1. Go to [Google AI Studio](https://aistudio.google.com/)
2. Click "Get API key"
3. Create a new API key
4. Copy the key for use in step 3

### 5. Your Space is Ready!
- The space will automatically build and deploy
- It will be available at: `https://huggingface.co/spaces/YOUR_USERNAME/business-card-extractor`
- All business card images and Excel files will be saved in the space

## Features Available in Hugging Face Spaces
βœ… **Full functionality**: All features work in Hugging Face Spaces  
βœ… **Image storage**: Business cards saved to `business_cards/` folder  
βœ… **Excel exports**: Download both current run and cumulative files  
βœ… **Persistent storage**: All data preserved between sessions  
βœ… **Batch processing**: Efficient 5-cards-per-API-call processing  

## Environment Variables Required
- `Gemini_API`: Your AI API key (required)

## Notes
- The space will create necessary directories automatically
- Logs are available in the space's terminal/logs
- All uploaded images are processed and optionally saved
- Excel files accumulate over time in the cumulative database