elina12 commited on
Commit
6e65022
1 Parent(s): 5b35d56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,17 +1,20 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
- pipe = pipeline(model="tarteel-ai/whisper-base-ar-quran")
 
 
 
 
5
 
6
  def transcribe(audio):
7
  text = pipe(audio)["text"]
8
  return text
9
 
10
  iface = gr.Interface(
11
- fn=transcribe,
12
- inputs=gr.Audio(source="upload", type="filepath"),
13
  outputs="text",
14
-
15
  )
16
 
17
  iface.launch()
 
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
+ # Define the path to the caching directory
5
+ cache_directory = "C:\Users\user\AppData\Local\transformers"
6
+
7
+ # Load the pipeline with the cache_dir parameter
8
+ pipe = pipeline(model="tarteel-ai/whisper-base-ar-quran", cache_dir=cache_directory)
9
 
10
  def transcribe(audio):
11
  text = pipe(audio)["text"]
12
  return text
13
 
14
  iface = gr.Interface(
15
+ fn=transcribe,
16
+ inputs=gr.Audio(source="upload", type="filepath"),
17
  outputs="text",
 
18
  )
19
 
20
  iface.launch()