Spaces:
Runtime error
Runtime error
csukuangfj
commited on
Commit
•
826449b
1
Parent(s):
2adf0c8
small fixes
Browse files
app.py
CHANGED
@@ -145,7 +145,7 @@ def process(
|
|
145 |
end = time.time()
|
146 |
|
147 |
metadata = torchaudio.info(filename)
|
148 |
-
duration =
|
149 |
rtf = (end - start) / duration
|
150 |
|
151 |
logging.info(f"Finished at {date_time} s. Elapsed: {end - start: .3f} s")
|
|
|
145 |
end = time.time()
|
146 |
|
147 |
metadata = torchaudio.info(filename)
|
148 |
+
duration = metadata.num_frames / sample_rate
|
149 |
rtf = (end - start) / duration
|
150 |
|
151 |
logging.info(f"Finished at {date_time} s. Elapsed: {end - start: .3f} s")
|
model.py
CHANGED
@@ -163,6 +163,10 @@ def _get_gigaspeech_pre_trained_model(
|
|
163 |
num_active_paths=num_active_paths,
|
164 |
)
|
165 |
|
|
|
|
|
|
|
|
|
166 |
|
167 |
@lru_cache(maxsize=10)
|
168 |
def _get_librispeech_pre_trained_model(
|
|
|
163 |
num_active_paths=num_active_paths,
|
164 |
)
|
165 |
|
166 |
+
recognizer = sherpa.OfflineRecognizer(config)
|
167 |
+
|
168 |
+
return recognizer
|
169 |
+
|
170 |
|
171 |
@lru_cache(maxsize=10)
|
172 |
def _get_librispeech_pre_trained_model(
|