File size: 1,885 Bytes
9f3349a
 
5403e87
 
 
 
 
 
 
9f3349a
 
5403e87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
title: Mmeslay
emoji: 🎙️
colorFrom: blue
colorTo: green
sdk: docker
python_version: "3.11"
pinned: true
short_description: "A Speech To Text System in Kabyle"
---

# 🎧 CLI Tool README

This project provides a simple command-line interface (CLI) for running audio inference, testing a model, or launching a Flask server.

---

## 📦 Features

- Run inference on a single audio file
- Batch test the model on a directory of audio files
- Launch a Flask API server

---

## 🚀 Installation

1. Clone the repository:

```bash
git clone <your-repo-url>
cd <your-repo-folder>
```

2. Install dependencies:

```bash
pip install -r requirements.txt
```

---

## 🛠️ Usage

Run the CLI using:

```bash
python src/cli.py [OPTIONS]
```

---

## 🔍 Options

| Option             | Description                                                    |
| ------------------ | -------------------------------------------------------------- |
| `--infer`          | Path to a single audio file for inference                      |
| `--test`           | Run model tests on a folder of audio files                     |
| `--audio_location` | Path to folder containing audio files (required with `--test`) |
| `--server`         | Launch the Flask server                                        |

---

## 🎯 Examples

### 1. Run Inference on a Single File

```bash
python src/cli.py --infer path/to/audio.wav
```

---

### 2. Run Model Tests on a Folder

```bash
python src/cli.py --test --audio_location path/to/audio_folder
```

- Validates the folder path
- Sets `AUDIO_LOCATION` as an environment variable
- Executes:

```bash
python src/model_test.py
```

⚠️ Note: `--audio_location` is required when using `--test`.

---

### 3. Launch Flask Server

```bash
python src/cli.py --server
```

- Starts the Flask server by running:

```bash
python src/flask_server.py
```

---