Update README.md
Browse files
README.md
CHANGED
@@ -81,7 +81,11 @@ input_dic['spectrogram'] = torch.from_numpy(lms).unsqueez(dim=0).to(device)
|
|
81 |
model.eval()
|
82 |
gen_ids = model.forward_test(input)
|
83 |
gen_text = model.neck.tokenizer.batch_decode(gen_ids.clip(0))
|
84 |
-
|
|
|
|
|
|
|
|
|
85 |
print(gen_text)
|
86 |
```
|
87 |
|
|
|
81 |
model.eval()
|
82 |
gen_ids = model.forward_test(input)
|
83 |
gen_text = model.neck.tokenizer.batch_decode(gen_ids.clip(0))
|
84 |
+
# 4. Post-processing
|
85 |
+
# Due to the training data, the generated texts will have some bias and require simple post-processing.
|
86 |
+
gen_text = gen_text.split('<s>')[-1].split('\n')[0].strip()
|
87 |
+
gen_text = gen_text.replace(' in Chinese','')
|
88 |
+
gen_text = gen_text.replace(' Chinese','')
|
89 |
print(gen_text)
|
90 |
```
|
91 |
|