Commit
·
0b67d28
1
Parent(s):
12317a8
- modeling_sensevoice.py +8 -1
modeling_sensevoice.py
CHANGED
|
@@ -1072,13 +1072,20 @@ class AudioEncoder(nn.Module):
|
|
| 1072 |
|
| 1073 |
# TODO
|
| 1074 |
# model_dir = "/data/models/FunAudioLLM/SenseVoiceSmall/"
|
|
|
|
|
|
|
| 1075 |
|
| 1076 |
if "_name_or_path" in config:
|
| 1077 |
model_dir = config._name_or_path
|
| 1078 |
else:
|
| 1079 |
-
|
| 1080 |
model_file= os.path.abspath(__file__)
|
| 1081 |
model_dir = os.path.dirname(model_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1082 |
|
| 1083 |
# self.model, self.kwargs = SenseVoiceSmall.from_pretrained(model_dir, device="cpu")
|
| 1084 |
self.model, self.kwargs = self.build_model(model=model_dir, trust_remote_code=False,)
|
|
|
|
| 1072 |
|
| 1073 |
# TODO
|
| 1074 |
# model_dir = "/data/models/FunAudioLLM/SenseVoiceSmall/"
|
| 1075 |
+
|
| 1076 |
+
import os
|
| 1077 |
|
| 1078 |
if "_name_or_path" in config:
|
| 1079 |
model_dir = config._name_or_path
|
| 1080 |
else:
|
| 1081 |
+
|
| 1082 |
model_file= os.path.abspath(__file__)
|
| 1083 |
model_dir = os.path.dirname(model_file)
|
| 1084 |
+
|
| 1085 |
+
if os.path.isfile(os.path.join(model_dir, "configuration.json")):
|
| 1086 |
+
pass
|
| 1087 |
+
else:
|
| 1088 |
+
model_dir = "iic/SenseVoiceSmall"
|
| 1089 |
|
| 1090 |
# self.model, self.kwargs = SenseVoiceSmall.from_pretrained(model_dir, device="cpu")
|
| 1091 |
self.model, self.kwargs = self.build_model(model=model_dir, trust_remote_code=False,)
|