phonemizer-eus-esp / README_developer.md
Ander Arriandiaga
Initial commit for Hugging Face Space
a7c0c81
# Phonemizer Gradio Space — Developer Notes
This repository contains a Gradio app wrapper for the Phonemizer used in this project.
Files to keep in the Space repo for runtime
- `gradio_phonemizer.py` (UI) and `eu_phonemizer_v2.py` (phonemizer logic)
- `app.py` (Gradio entrypoint)
- `modulo1y2/modulo1y2` (the phonemizer executable) OR source+build files in `modulo1y2/`
- `dict/` containing `eu_dicc` (or `eu_dicc.dic`) and `es_dicc` (or `es_dicc.dic`)
- `requirements.txt`
Recommended deployment options
- Ship the `modulo1y2` executable and the minimal dictionary files in the repo (fastest).
- OR keep only sources and build the executable on Space startup using an `apt.txt` and a `make` step.
- OR host large dictionaries/executables on the Hugging Face Hub (dataset/model repo) and download them at startup using `huggingface_hub.hf_hub_download`.
Quick local test
1. Create a venv and install dependencies:
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
2. Ensure the executable is present and executable:
```bash
chmod +x modulo1y2/modulo1y2
ls -l modulo1y2/modulo1y2
ls -l dict/eu_dicc* dict/es_dicc*
```
3. Run the app locally:
```bash
python app.py
# then open http://localhost:7860
```
Pushing to Hugging Face Spaces
1. (Optional) Install git-lfs and track large files:
```bash
git lfs install
git lfs track "dict/*"
git lfs track "modulo1y2/modulo1y2"
```
2. Create a Space (via web UI or `huggingface-cli repo create <user>/<space> --type=space`), then push this repo to the Space remote.
Licensing and redistribution
Before uploading binaries or dictionary files, confirm you have the right to redistribute them.