File size: 1,842 Bytes
4c5e815
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
datasets:
- AL-GR/Item-EMB
language:
- zh
---
# Forge-SID-Model

This repository contains a pre-trained **RQVAE (Residual Quantized Variational Autoencoder)** model designed for **SID (Speaker Identity/Structure) generation** tasks. It is part of the [FORGE](https://github.com/AL-GR/FORGE) ecosystem.

The model weights are stored in `final_sid_rq_model.pth`.

## Usage

### 1. Download the Model

You can download the model files locally using the `huggingface_hub` library:

```python
import os
# Optional: Use mirror for faster download in some regions (e.g., China)
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com" 
os.environ["KMP_DUPLICATE_LIB_OK"] = "True"

from huggingface_hub import snapshot_download

snapshot_download(
    repo_id='AL-GR/Forge-SID-Model',
    local_dir='./Forge-SID-Model',  # Replace with your desired local path
    local_dir_use_symlinks=False,
)
```

### 2. Run Inference

To use this model for inference, you need to update the checkpoint path in the official inference script provided by the `al_sid` repository.

**Step 1:** Clone or download the inference code:
[https://github.com/selous123/al_sid/blob/main/SID_generation/infer_SID.py](https://github.com/selous123/al_sid/blob/main/SID_generation/infer_SID.py)

**Step 2:** Open `infer_SID.py` and locate **Line 23**.

**Step 3:** Modify the `CKPT_PATH` variable to point to your downloaded `.pth` file:

```python
# Original line:
# CKPT_PATH = 'output_model/checkpoint-7.pth'

# Update to (example):
CKPT_PATH = './Forge-SID-Model/final_sid_rq_model.pth' 
```

> **Note**: Ensure the path matches the actual location where you saved the `final_sid_rq_model.pth` file.

---

For more details about the training setup or the FORGE framework, please refer to the main repository: [AL-GR/FORGE](https://github.com/AL-GR/FORGE).