Spaces:
Runtime error
Runtime error
Commit
·
e3b197f
1
Parent(s):
29b08f8
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
import numpy as np
|
3 |
from transformers.file_utils import cached_path, hf_bucket_url
|
4 |
import os
|
@@ -9,8 +10,8 @@ import kenlm
|
|
9 |
import torchaudio
|
10 |
|
11 |
cache_dir = './cache/'
|
12 |
-
processor = Wav2Vec2ProcessorWithLM.from_pretrained("ahmedJaafari/Annarabic3.2", cache_dir=cache_dir, use_auth_token="
|
13 |
-
model = AutoModelForCTC.from_pretrained("ahmedJaafari/Annarabic3.2", cache_dir=cache_dir, use_auth_token="
|
14 |
|
15 |
# define function to read in sound file
|
16 |
def speech_file_to_array_fn(path, max_seconds=10):
|
|
|
1 |
import gradio as gr
|
2 |
+
import streamlit as st
|
3 |
import numpy as np
|
4 |
from transformers.file_utils import cached_path, hf_bucket_url
|
5 |
import os
|
|
|
10 |
import torchaudio
|
11 |
|
12 |
cache_dir = './cache/'
|
13 |
+
processor = Wav2Vec2ProcessorWithLM.from_pretrained("ahmedJaafari/Annarabic3.2", cache_dir=cache_dir, use_auth_token=st.secrets["AnnarabicToken"])
|
14 |
+
model = AutoModelForCTC.from_pretrained("ahmedJaafari/Annarabic3.2", cache_dir=cache_dir, use_auth_token=st.secrets["AnnarabicToken"])
|
15 |
|
16 |
# define function to read in sound file
|
17 |
def speech_file_to_array_fn(path, max_seconds=10):
|