generated from habedi/template-python-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
896 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[run] | ||
# Exclude test files and specific init files from the coverage report | ||
omit = | ||
*/tests/* | ||
*/test_*.py | ||
*/__init__.py # Good idea to exclude __init__.py files from the coverage report | ||
|
||
# Include source files only from certain directories | ||
source = | ||
easy_letters | ||
notebooks | ||
|
||
# Set parallel to true if you run tests in parallel | ||
parallel = True | ||
|
||
# Enable branch coverage if set to True | ||
branch = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,73 @@ | ||
# Adding the following lines to the .gitattributes file will tell Git to treat the files as binary data. | ||
*.text filter=lfs diff=lfs merge=lfs -text | ||
*.png filter=lfs diff=lfs merge=lfs -text | ||
# Common document and text file formats | ||
*.docx filter=lfs diff=lfs merge=lfs -text | ||
*.doc filter=lfs diff=lfs merge=lfs -text | ||
*.pdf filter=lfs diff=lfs merge=lfs -text | ||
*.djvu filter=lfs diff=lfs merge=lfs -text | ||
*.eps filter=lfs diff=lfs merge=lfs -text | ||
*.odt filter=lfs diff=lfs merge=lfs -text | ||
*.rtf filter=lfs diff=lfs merge=lfs -text | ||
*.ps filter=lfs diff=lfs merge=lfs -text | ||
*.xls filter=lfs diff=lfs merge=lfs -text | ||
*.xlsx filter=lfs diff=lfs merge=lfs -text | ||
*.ppt filter=lfs diff=lfs merge=lfs -text | ||
*.pptx filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common image formats | ||
*.jpg filter=lfs diff=lfs merge=lfs -text | ||
*.jpeg filter=lfs diff=lfs merge=lfs -text | ||
*.png filter=lfs diff=lfs merge=lfs -text | ||
*.gif filter=lfs diff=lfs merge=lfs -text | ||
*.csv filter=lfs diff=lfs merge=lfs -text | ||
*.bmp filter=lfs diff=lfs merge=lfs -text | ||
*.tiff filter=lfs diff=lfs merge=lfs -text | ||
*.tif filter=lfs diff=lfs merge=lfs -text | ||
*.svgz filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common compressed file formats | ||
*.zip filter=lfs diff=lfs merge=lfs -text | ||
*.gz filter=lfs diff=lfs merge=lfs -text | ||
*.tar filter=lfs diff=lfs merge=lfs -text | ||
*.tgz filter=lfs diff=lfs merge=lfs -text | ||
*.bz2 filter=lfs diff=lfs merge=lfs -text | ||
*.7z filter=lfs diff=lfs merge=lfs -text | ||
*.rar filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common file formats in machine learning projects | ||
*.bin filter=lfs diff=lfs merge=lfs -text | ||
*.model filter=lfs diff=lfs merge=lfs -text | ||
*.h5 filter=lfs diff=lfs merge=lfs -text | ||
*.tfrecord filter=lfs diff=lfs merge=lfs -text | ||
*.hdf5 filter=lfs diff=lfs merge=lfs -text | ||
*.keras filter=lfs diff=lfs merge=lfs -text | ||
*.pth filter=lfs diff=lfs merge=lfs -text | ||
*.pt filter=lfs diff=lfs merge=lfs -text | ||
*.joblib filter=lfs diff=lfs merge=lfs -text | ||
*.pkl filter=lfs diff=lfs merge=lfs -text | ||
*.pickle filter=lfs diff=lfs merge=lfs -text | ||
*.npy filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common audio and video formats | ||
*.mp3 filter=lfs diff=lfs merge=lfs -text | ||
*.mp4 filter=lfs diff=lfs merge=lfs -text | ||
*.wav filter=lfs diff=lfs merge=lfs -text | ||
*.avi filter=lfs diff=lfs merge=lfs -text | ||
*.mov filter=lfs diff=lfs merge=lfs -text | ||
*.flac filter=lfs diff=lfs merge=lfs -text | ||
*.mkv filter=lfs diff=lfs merge=lfs -text | ||
*.webm filter=lfs diff=lfs merge=lfs -text | ||
*.ogg filter=lfs diff=lfs merge=lfs -text | ||
*.ogv filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Common data transfer formats | ||
#*.csv filter=lfs diff=lfs merge=lfs -text | ||
#*.tsv filter=lfs diff=lfs merge=lfs -text | ||
#*.json filter=lfs diff=lfs merge=lfs -text | ||
#*.xml filter=lfs diff=lfs merge=lfs -text | ||
*.parquet filter=lfs diff=lfs merge=lfs -text | ||
*.feather filter=lfs diff=lfs merge=lfs -text | ||
*.msgpack filter=lfs diff=lfs merge=lfs -text | ||
*.avro filter=lfs diff=lfs merge=lfs -text | ||
*.arrow filter=lfs diff=lfs merge=lfs -text | ||
*.orc filter=lfs diff=lfs merge=lfs -text | ||
|
||
# Exclude files from language stats (GitHub Linguist) | ||
*.ipynb linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,77 @@ | ||
# Easy Letters | ||
## Easy Letters | ||
|
||
[](https://badge.fury.io/py/easy-letters) | ||
[](https://opensource.org/licenses/MIT) | ||
[](https://github.com/habedi/easy-letters) | ||
[](https://pypi.org/project/easy-letters/) | ||
[](https://github.com/habedi/easy-letters/actions/workflows/tests.yml) | ||
[](https://codecov.io/gh/habedi/easy-letters) | ||
[](https://www.codefactor.io/repository/github/habedi/easy-letters) | ||
[](https://github.com/habedi/easy-letters) | ||
[](https://github.com/habedi/easy-letters/blob/main/LICENSE) | ||
[](https://badge.fury.io/py/easy-letters) | ||
[](https://pypi.org/project/easy-letters/) | ||
|
||
Easy Letters is a Python package that helps job seekers write application letters. A simple retrieval | ||
augmented generation (RAG) pipeline is used to generate the letters. The user can then edit the draft letter to suit | ||
their needs. | ||
Easy Letters is a Python library that provides the basic building blocks for creating a naive [retrieval augmented | ||
generation (or RAG)](https://arxiv.org/abs/2312.10997) pipeline to generate application letter drafts. | ||
The main idea is to speed up the process of writing application letters by not starting from scratch. | ||
Instead, an applicant could generate a draft letter that can be used as a starting point and customized as needed | ||
to make the final letter. | ||
|
||
See the `notebooks/README.md` file for how easy letters works. | ||
The diagram below shows the high-level workflow of how Easy Letters can be used to generate draft application | ||
letters. | ||
|
||
## 🔧 Installation | ||
 | ||
|
||
You can install Easy Letters using pip: | ||
### Installation | ||
|
||
```bash | ||
pip install easy-letters | ||
``` | ||
|
||
## 🚀 Getting Started | ||
|
||
### API Key Setup | ||
#### Installing from Source | ||
|
||
At the moment, Easy Letters gets the API key for supported services from the environment variables. | ||
So you need to set the following environment variables to be able to use Easy Letters: | ||
|
||
- `OPENAI_API_KEY`: The OpenAI API key (required) | ||
You can also install Easy Letters from the source code in this repository. | ||
The main benefit of this approach is that you might find it easier to run the sample notebooks and modify the code as | ||
you wish this way. | ||
|
||
### Sample Notebooks | ||
After cloning this repository, you can navigate to the directory where you cloned the repository and install the | ||
dependencies using [Poetry](https://python-poetry.org/): | ||
|
||
You can find Jupyter notebooks with example code in the `notebooks` directory. | ||
The notebooks demonstrate how to use Easy Letters to generate application letter drafts. | ||
```bash | ||
git clone https://github.com/habedi/easy-letters.git && cd easy-letters | ||
|
||
### Supported Models | ||
# Install the dependencies using Poetry | ||
poetry install --with dev | ||
``` | ||
|
||
Easy Letters currently supports the following models: | ||
### Getting Started | ||
|
||
| Model | Type | | ||
|----------------------------------|-----------------| | ||
| GPT-3.5 Turbo | Text Generation | | ||
| GPT-4 Turbo | Text Generation | | ||
| GPT-4o | Text Generation | | ||
| GPT-4o Mini | Text Generation | | ||
| Text Embedding 3 (Small Variant) | Text Embedding | | ||
| Text Embedding 3 (Large Variant) | Text Embedding | | ||
#### API Key Setup | ||
|
||
### Installing from Source | ||
Easy Letters gets the API key for supported services (like [OpenAI](https://platform.openai.com/)) from the environment | ||
variables. | ||
So you need to set the following environment variables to be able to use Easy Letters: | ||
|
||
You can also install Easy Letters from the source code in this repository. The main benefit of this approach is that | ||
you might find it easier to run the sample notebooks and modify the code as you wish this way. | ||
- `OPENAI_API_KEY`: The [OpenAI API key](https://platform.openai.com/docs/api-reference/authentication) (required) | ||
|
||
After cloning this repository, you can navigate to the `easy-letters` directory and install the | ||
dependencies using [Poetry](https://python-poetry.org/): | ||
#### Sample Notebooks | ||
|
||
```bash | ||
git clone https://github.com/habedi/easy-letters.git && cd easy-letters | ||
You can find Jupyter notebooks with example code in the [notebooks](notebooks/) directory. | ||
The notebooks demonstrate how to use Easy Letters to generate application letter drafts. | ||
|
||
# Assuming you have Poetry installed on your system | ||
poetry install --with dev | ||
``` | ||
### Supported Models | ||
|
||
### Running the Unit Tests with Coverage | ||
Easy Letters currently supports the following models: | ||
|
||
You can run the unit tests with coverage using the following command: | ||
| Model | Type | Company | | ||
|----------------------------------|-----------------|---------| | ||
| GPT-3.5 Turbo | Text Generation | OpenAI | | ||
| GPT-4 Turbo | Text Generation | OpenAI | | ||
| GPT-4o | Text Generation | OpenAI | | ||
| GPT-4o Mini | Text Generation | OpenAI | | ||
| Text Embedding 3 (Small Variant) | Text Embedding | OpenAI | | ||
| Text Embedding 3 (Large Variant) | Text Embedding | OpenAI | | ||
|
||
```bash | ||
poetry run pytest tests/ --cov=easy_letters | ||
``` | ||
> [!NOTE] | ||
> At the moment, Easy Letters only supports text generation and text embedding models from OpenAI. | ||
## 📝 TODO | ||
### License | ||
|
||
- [ ] Add support for Anthropic models and API | ||
- [ ] Add support for locally served models via Ollama | ||
Easy Letters is available under the MIT license ([LICENSE](LICENSE)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# You need to have Graphviz installed to run this script | ||
# On Debian-based systems, you can install it using: sudo apt-get install graphviz | ||
|
||
# Make figures from .dot files | ||
for f in *.dot; do | ||
dot -Tsvg $f -o ${f%.dot}.svg | ||
done |
File renamed without changes.
Oops, something went wrong.