Skip to content

Commit 795229a

Browse files
committed
Update set-up instructions
1 parent 043a997 commit 795229a

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

README.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The goal of the Ballot Initiative project is to reduce the manual labor involved
4040

4141
![Core Algorithm](app/ballot_initiative_schematic.png)
4242

43-
1. **Extraction:** Forms in PDF format are processed through an OCR engine (using [gpt-4o-mini](https://platform.openai.com/docs/models/gpt-4o-mini)) to crop text sections and extract data.
43+
1. **Extraction:** Forms in PDF format are processed through an OCR engine (using generative AI) to crop text sections and extract data.
4444

4545
2. **Identification:** The engine identifies and extracts key information (tailored to DC Ballot Initiatives) related to validating signatures:
4646

@@ -63,10 +63,14 @@ An alternate approach to get up and running is to use [Github Codespaces](https:
6363

6464
### Prerequisites
6565

66-
- Python 3.12
67-
- OpenAI API key[^1]
66+
- [Python 3.12+](https://wiki.python.org/moin/BeginnersGuide/Download)
67+
- [UV](https://docs.astral.sh/uv/getting-started/installation/) for building the project
68+
- API keys for at least one of the following[^1]:
69+
- [OpenAI API key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key)
70+
- [Mistral API key](https://docs.mistral.ai/getting-started/quickstart/)
71+
- [Gemini API key](https://ai.google.dev/gemini-api/docs/api-key)
6872

69-
[^1]: The OpenAI free tier has a low rate limit. To increase the rate limit, you'll have to have a form payment on your OpenAI account. [See this page for details](https://platform.openai.com/docs/guides/rate-limits?tier=tier-one)
73+
[^1]: The free tiers for these services typically have a low rate limit that can cause issues. Many services require adding a payment method to your account to increase rate limits. Please verify your account settings and usage limits before running the application.
7074

7175
- PDF files of ballot initiative signatures
7276
- Use fake data in [`sample_data/fake_signed_petitions.pdf`](sample_data/fake_signed_petitions.pdf) folder to test.
@@ -86,8 +90,8 @@ cd ballot-initiative
8690
2. Create and activate a virtual environment:
8791

8892
```bash
89-
# Create virtual environment
90-
python -m venv venv
93+
# Initalise project and install dependencies
94+
uv sync --all-extras --dev
9195

9296
# Activate virtual environment
9397
# On Windows:
@@ -96,29 +100,20 @@ venv\Scripts\activate
96100
source venv/bin/activate
97101
```
98102

99-
3. Install dependencies:
100-
101-
```bash
102-
pip install -r requirements.txt
103-
```
104-
105-
4. Set up your environment:
106-
- Create a `.env` file in the project root folder.
107-
- Replicate the format shown in the `.env.example` file.
108-
- [Get an OpenAI API key](https://www.howtogeek.com/885918/how-to-get-an-openai-api-key/) if you don't have one
109-
- Add your OpenAI API key to the `.env` file:
110-
```
111-
OPENAI_API_KEY=<YOUR_API_KEY>
112-
```
103+
3. Configure and save settings:
104+
- Make a copy of the `settings.example.toml` file and rename it to `settings.toml`.
105+
- Add your GenAI API keys to the `api_key` field of the selected model
106+
- Add the name of the model to the `model` field e.g. `mistral-small-latest` or `gpt-4o-mini`
113107

114108
### Running the Application
115109

116110
1. Start the Streamlit app:
117111

118112
```bash
119-
streamlit run app/Home.py
113+
uv run main.py
120114
```
121115

116+
122117
2. Upload your files:
123118
- PDF of signed petitions
124119
- Voter records file
@@ -131,7 +126,7 @@ streamlit run app/Home.py
131126
3. Run the following command:
132127

133128
```bash
134-
python pytest
129+
uv run pytest
135130
```
136131

137132
## Project Documentation

0 commit comments

Comments
 (0)