Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,8 +12,9 @@ app = Flask(__name__)
|
|
12 |
tokenizer = Wav2Vec2Tokenizer.from_pretrained("facebook/wav2vec2-base-960h")
|
13 |
model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")
|
14 |
|
15 |
-
# Load translation
|
16 |
-
|
|
|
17 |
|
18 |
# Function to preprocess audio
|
19 |
def preprocess_audio(audio_file):
|
@@ -53,3 +54,4 @@ def translate():
|
|
53 |
if __name__ == '__main__':
|
54 |
app.run(debug=True, host='0.0.0.0', port=8080)
|
55 |
|
|
|
|
12 |
tokenizer = Wav2Vec2Tokenizer.from_pretrained("facebook/wav2vec2-base-960h")
|
13 |
model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")
|
14 |
|
15 |
+
# Load translation model explicitly
|
16 |
+
translation_model = "Helsinki-NLP/opus-mt-en-hi"
|
17 |
+
translation_pipeline = pipeline("translation", model=translation_model)
|
18 |
|
19 |
# Function to preprocess audio
|
20 |
def preprocess_audio(audio_file):
|
|
|
54 |
if __name__ == '__main__':
|
55 |
app.run(debug=True, host='0.0.0.0', port=8080)
|
56 |
|
57 |
+
|