Spaces:
Runtime error
Runtime error
kevinwang676
commited on
Commit
•
c406fb5
1
Parent(s):
2969413
Update cosyvoice/cli/model.py
Browse files- cosyvoice/cli/model.py +3 -3
cosyvoice/cli/model.py
CHANGED
@@ -25,11 +25,11 @@ class CosyVoiceModel:
|
|
25 |
self.hift = hift
|
26 |
|
27 |
def load(self, llm_model, flow_model, hift_model):
|
28 |
-
self.llm.load_state_dict(torch.load(llm_model, map_location=
|
29 |
self.llm.to(self.device).eval()
|
30 |
-
self.flow.load_state_dict(torch.load(flow_model, map_location=
|
31 |
self.flow.to(self.device).eval()
|
32 |
-
self.hift.load_state_dict(torch.load(hift_model, map_location=
|
33 |
self.hift.to(self.device).eval()
|
34 |
|
35 |
def inference(self, text, text_len, flow_embedding, llm_embedding=torch.zeros(0, 192),
|
|
|
25 |
self.hift = hift
|
26 |
|
27 |
def load(self, llm_model, flow_model, hift_model):
|
28 |
+
self.llm.load_state_dict(torch.load(llm_model, map_location="cpu"))
|
29 |
self.llm.to(self.device).eval()
|
30 |
+
self.flow.load_state_dict(torch.load(flow_model, map_location="cpu"))
|
31 |
self.flow.to(self.device).eval()
|
32 |
+
self.hift.load_state_dict(torch.load(hift_model, map_location="cpu"))
|
33 |
self.hift.to(self.device).eval()
|
34 |
|
35 |
def inference(self, text, text_len, flow_embedding, llm_embedding=torch.zeros(0, 192),
|