File size: 1,693 Bytes
a7c0c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 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.