sonobit commited on
Commit
62289a0
·
1 Parent(s): bba37db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -1,8 +1,12 @@
1
  import gradio as gr
2
  from transformers import pipeline
 
3
 
4
- # Specify the task for the pipeline
5
- p = pipeline('text-generation', model='wannaphong/wav2vec2-large-xlsr-53-th-cv8-deepcut')
 
 
 
6
 
7
  def transcribe(audio):
8
  # Pass the audio file to the pipeline and obtain the output
 
1
  import gradio as gr
2
  from transformers import pipeline
3
+ from transformers import AutoTokenizer
4
 
5
+ # Create a PretrainedTokenizer object
6
+ tokenizer = AutoTokenizer.from_pretrained('wannaphong/wav2vec2-large-xlsr-53-th-cv8-deepcut')
7
+
8
+ # Pass the PretrainedTokenizer object as the tokenizer argument
9
+ p = pipeline('text-generation', model='wannaphong/wav2vec2-large-xlsr-53-th-cv8-deepcut', tokenizer=tokenizer)
10
 
11
  def transcribe(audio):
12
  # Pass the audio file to the pipeline and obtain the output