lengyue233
commited on
Commit
•
c0b9ba1
1
Parent(s):
16b7417
update for clarify
Browse files
README.md
CHANGED
@@ -13,6 +13,9 @@ class HubertModelWithFinalProj(HubertModel):
|
|
13 |
def __init__(self, config):
|
14 |
super().__init__(config)
|
15 |
|
|
|
|
|
|
|
16 |
self.final_proj = nn.Linear(config.hidden_size, config.classifier_proj_size)
|
17 |
```
|
18 |
|
@@ -21,7 +24,6 @@ and then load the model with
|
|
21 |
model = HubertModelWithFinalProj.from_pretrained("lengyue233/content-vec-best")
|
22 |
|
23 |
x = model(audio)["last_hidden_state"]
|
24 |
-
x = model.final_proj(x)
|
25 |
```
|
26 |
|
27 |
## How to convert
|
|
|
13 |
def __init__(self, config):
|
14 |
super().__init__(config)
|
15 |
|
16 |
+
# The final projection layer is only used for backward compatibility.
|
17 |
+
# Following https://github.com/auspicious3000/contentvec/issues/6
|
18 |
+
# Remove this layer is necessary to achieve the desired outcome.
|
19 |
self.final_proj = nn.Linear(config.hidden_size, config.classifier_proj_size)
|
20 |
```
|
21 |
|
|
|
24 |
model = HubertModelWithFinalProj.from_pretrained("lengyue233/content-vec-best")
|
25 |
|
26 |
x = model(audio)["last_hidden_state"]
|
|
|
27 |
```
|
28 |
|
29 |
## How to convert
|