Spaces:
Build error
Build error
Michael Hu commited on
Commit ·
4de4aab
1
Parent(s): c0cc079
try monkey patch method from https://github.com/resemble-ai/chatterbox/issues/96
Browse files
app.py
CHANGED
|
@@ -5,6 +5,15 @@ import tempfile
|
|
| 5 |
import os
|
| 6 |
from chatterbox.mtl_tts import ChatterboxMultilingualTTS
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
# Initialize the multilingual model
|
| 9 |
try:
|
| 10 |
model = ChatterboxMultilingualTTS.from_pretrained(device="cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 5 |
import os
|
| 6 |
from chatterbox.mtl_tts import ChatterboxMultilingualTTS
|
| 7 |
|
| 8 |
+
original_torch_load = torch.load
|
| 9 |
+
|
| 10 |
+
def patched_torch_load(f, map_location=None, **kwargs):
|
| 11 |
+
if map_location is None:
|
| 12 |
+
map_location = 'cpu'
|
| 13 |
+
return original_torch_load(f, map_location=map_location, **kwargs)
|
| 14 |
+
|
| 15 |
+
torch.load = patched_torch_load
|
| 16 |
+
|
| 17 |
# Initialize the multilingual model
|
| 18 |
try:
|
| 19 |
model = ChatterboxMultilingualTTS.from_pretrained(device="cuda" if torch.cuda.is_available() else "cpu")
|