Spaces:
Runtime error
Runtime error
Create wav2vec2_import.py
Browse files- wav2vec2_import.py +12 -0
wav2vec2_import.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
import importlib
|
3 |
+
|
4 |
+
# Check if wav2vec2 module is already in sys.modules
|
5 |
+
if 'wav2vec2' not in sys.modules:
|
6 |
+
wav2vec2 = importlib.import_module('wav2vec2')
|
7 |
+
else:
|
8 |
+
wav2vec2 = sys.modules['wav2vec2']
|
9 |
+
|
10 |
+
# Import necessary classes
|
11 |
+
Wav2Vec2Model = wav2vec2.Wav2Vec2Model
|
12 |
+
Wav2Vec2Config = wav2vec2.Wav2Vec2Config
|