Skip to content

Commit baebbb6

Browse files
committed
v0.0.3 infer-cli ready
1 parent 50d5756 commit baebbb6

8 files changed

Lines changed: 483 additions & 27 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Customed
22
results/
3+
tests/
34

45
# Byte-compiled / optimized / DLL files
56
__pycache__/

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,30 @@ habibi-tts_infer-gradio
3131

3232
## CLI Usage
3333
```bash
34-
# Single test with CLI
35-
# TODO
34+
# Default using the Unified model (recommanded)
35+
habibi-tts_infer-cli \
36+
--ref_audio "assets/MSA.mp3" \
37+
--ref_text "كان اللعيب حاضرًا في العديد من الأنشطة والفعاليات المرتبطة بكأس العالم، مما سمح للجماهير بالتفاعل معه والتقاط الصور التذكارية." \
38+
--gen_text "أهلًا، يبدو أن هناك بعض التعقيدات، لكن لا تقلق، سأرشدك بطريقة سلسة وواضحة خطوة بخطوة."
39+
40+
# Assign the dialect ID, rather than inferred from given reference prompt (UNK, by default)
41+
# (best use matched dialectal content with ID: MSA, SAU, UAE, ALG, IRQ, EGY, IRQ, OMN, TUN, LEV, SDN, LBY)
42+
habibi-tts_infer-cli --dialect MSA
43+
44+
# Alternatively, use `.toml` file to config, see `src/habibi_tts/infer/example.toml`
45+
habibi-tts_infer-cli -c YOUR_CUSTOM.toml
46+
47+
# Check more CLI features with
48+
habibi-tts_infer-cli --help
3649
```
3750

51+
> [!NOTE]
52+
> Some dialectal audio samples are provided under `src/habibi_tts/assets`, see the relevant [README.md](https://github.com/SWivid/Habibi-TTS/blob/main/src/habibi_tts/assets/README.md) for usage and more details.
53+
3854

3955
## Benchmarking
4056
```bash
41-
# TODO
57+
# SOON
4258
```
4359

4460

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "habibi-tts"
7-
version = "0.0.2"
7+
version = "0.0.3"
88
description = "Habibi: Laying the Open-Source Foundation of Unified-Dialectal Arabic Speech Synthesis"
99
readme = "README.md"
1010
license = {text = "MIT License"}
@@ -22,4 +22,5 @@ dependencies = [
2222
Homepage = "https://github.com/SWivid/Habibi-TTS"
2323

2424
[project.scripts]
25+
"habibi-tts_infer-cli" = "habibi_tts.infer.infer_cli:main"
2526
"habibi-tts_infer-gradio" = "habibi_tts.infer.infer_gradio:main"

src/habibi_tts/assets/README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
## Reference Prompts Examples Used for Inference
22

3-
MP3 files are from ElevenLabs voice library, named same as Voice ID, WAV files are from [Habibi benchmark](https://huggingface.co/datasets/SWivid/Habibi).
3+
1. MP3 files are from ElevenLabs voice library, named same as Voice ID, WAV files are from [Habibi benchmark](https://huggingface.co/datasets/SWivid/Habibi). See the [Habibi paper](https://arxiv.org/abs/2601.13802) for more details.
4+
2. The terminology does not reflect any official classification for Arabic. Each sample is just for example, only reflects a part of the corresponding ID.
45

5-
### MSA
6+
7+
### MSA (Modern Standard Arabic)
68
```bash
79
# MSA.mp3 (JjTirzdD7T3GMLkwdd3a)
810
"كان اللعيب حاضرًا في العديد من الأنشطة والفعاليات المرتبطة بكأس العالم، مما سمح للجماهير بالتفاعل معه والتقاط الصور التذكارية."
911
```
1012

11-
### SAU
13+
### SAU (Najdi, Hijazi, Gulf, etc.)
1214
```bash
1315
# Najdi.wav (6k_SBA_22_2-seg_410_975-416_518)
1416
"تكفى طمني انا اليوم ماني بنايم ولا هو بداخل عيني النوم الين اتطمن عليه."
@@ -20,32 +22,50 @@ MP3 files are from ElevenLabs voice library, named same as Voice ID, WAV files a
2022
"وين تو الناس متى تصحى ومتى تفطر وتغير يبيلك ساعة يعني بالله تروح الشغل الساعة عشره."
2123
```
2224

23-
### UAE
25+
### UAE (Emirati)
2426
```bash
2527
# UAE.wav (13_segment_108)
2628
"قمنا نشتريها بشكل متكرر أو لما نلقى ستايل يعجبنا وحياناً هذا الستايل ما نحبه."
2729
```
2830

29-
### ALG
31+
### ALG (Algerian & Algerian Saharan)
3032
```bash
3133
# ALG.wav (yCfWAGx6aTw-162)
3234
"أنيا هكا باغية ناكل هكا أني ن نشوف فيها الحاجة هذيكا."
3335
```
3436

35-
### IRQ
37+
### IRQ (Mesopotamian & North Mesopotamian)
3638
```bash
3739
# IRQ.wav (P9zYhlu5pzw-613)
3840
"يعني ااا ما نقدر ناخذ وقت أكثر، ااا لأنه شروط كلش يحتاجلها وقت."
3941
```
4042

41-
### EGY
43+
### EGY (Egyptian, Saidi, etc.)
4244
```bash
4345
# EGY.mp3 (IES4nrmZdUBHByLBde0P)
4446
"ايه الكلام. بقولك ايه. استخدم صوتي في المحادثات. استخدمه هيعجبك اوي."
4547
```
4648

47-
### MAR
49+
### MAR (Moroccan or Darija)
4850
```bash
4951
# MAR.mp3 (OfGMGmhShO8iL9jCkXy8)
5052
"إذا بغيتي شي صوت باللهجة المغربية للإعلانات ديالك هذا أحسن واحد غادي تلقاه."
5153
```
54+
55+
### OMN (Omani, Dhofari, etc.)
56+
N/A
57+
58+
### TUN (Tunisian)
59+
N/A
60+
61+
### LEV (Levantine)
62+
N/A
63+
64+
### SDN (Sudanese)
65+
N/A
66+
67+
### LBY (Libyan)
68+
N/A
69+
70+
### UNK (Unknown)
71+
N/A

src/habibi_tts/infer/example.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Unified | Specialized
2+
model = "Unified"
3+
# MSA | SAU | UAE | ALG | IRQ | EGY | IRQ | UNK
4+
dialect = "UNK"
5+
ref_audio = "assets/MSA.mp3"
6+
ref_text = "كان اللعيب حاضرًا في العديد من الأنشطة والفعاليات المرتبطة بكأس العالم، مما سمح للجماهير بالتفاعل معه والتقاط الصور التذكارية."
7+
gen_text = "أهلًا، يبدو أن هناك بعض التعقيدات، لكن لا تقلق، سأرشدك بطريقة سلسة وواضحة خطوة بخطوة."
8+
# File with text to generate. Ignores the text above.
9+
gen_file = ""
10+
remove_silence = false
11+
output_dir = "tests"
12+
output_file = "infer_cli_example.wav"

0 commit comments

Comments
 (0)