Beehzod commited on
Commit
0b575c2
·
verified ·
1 Parent(s): b4e7019

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -4,7 +4,16 @@ from transformers import pipeline
4
  import io
5
 
6
  # Load the model
7
- pipe = pipeline("automatic-speech-recognition", model="facebook/seamless-m4t-v2-large")
 
 
 
 
 
 
 
 
 
8
 
9
  # Streamlit title and instructions
10
  st.title("Real-Time Speech Recognition")
 
4
  import io
5
 
6
  # Load the model
7
+ #pipe = pipeline("automatic-speech-recognition", model="facebook/seamless-m4t-v2-large")
8
+
9
+ from transformers import AutoTokenizer
10
+
11
+ # Load the correct tokenizer for the model
12
+ tokenizer = AutoTokenizer.from_pretrained("facebook/seamless-m4t-v2-large")
13
+
14
+ # Initialize the pipeline
15
+ pipe = pipeline("automatic-speech-recognition", model="facebook/seamless-m4t-v2-large", tokenizer=tokenizer)
16
+
17
 
18
  # Streamlit title and instructions
19
  st.title("Real-Time Speech Recognition")