Spaces:
Sleeping
Sleeping
VenkateshRoshan
commited on
Commit
·
2a73da8
1
Parent(s):
b6ea18a
Case-Study 4 updated dockerfile and using API only
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ pipe = pipeline("automatic-speech-recognition", model=model_id) #, device=device
|
|
28 |
|
29 |
print(f'The Server is Running with prometheus Metrics enabled !!!')
|
30 |
|
31 |
-
def transcribe(inputs, use_api):
|
32 |
start = time.time()
|
33 |
API_STATUS = ''
|
34 |
|
@@ -98,7 +98,7 @@ mf_transcribe = gr.Interface(
|
|
98 |
inputs=[
|
99 |
gr.Audio(sources="microphone", type="filepath"),
|
100 |
# gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
|
101 |
-
gr.Checkbox(label="Use API", value=
|
102 |
],
|
103 |
outputs=[gr.Textbox(label="Transcribed Text", type="text"),
|
104 |
gr.Textbox(label="Time taken", type="text"),
|
@@ -116,7 +116,7 @@ file_transcribe = gr.Interface(
|
|
116 |
inputs=[
|
117 |
gr.Audio(sources="upload", type="filepath", label="Audio file"),
|
118 |
# gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
|
119 |
-
gr.Checkbox(label="Use API", value=False) # Checkbox for API usage
|
120 |
],
|
121 |
outputs=[ gr.Textbox(label="Transcribed Text", type="text"),
|
122 |
gr.Textbox(label="Time taken", type="text"),
|
|
|
28 |
|
29 |
print(f'The Server is Running with prometheus Metrics enabled !!!')
|
30 |
|
31 |
+
def transcribe(inputs, use_api=True):
|
32 |
start = time.time()
|
33 |
API_STATUS = ''
|
34 |
|
|
|
98 |
inputs=[
|
99 |
gr.Audio(sources="microphone", type="filepath"),
|
100 |
# gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
|
101 |
+
# gr.Checkbox(label="Use API", value=True)
|
102 |
],
|
103 |
outputs=[gr.Textbox(label="Transcribed Text", type="text"),
|
104 |
gr.Textbox(label="Time taken", type="text"),
|
|
|
116 |
inputs=[
|
117 |
gr.Audio(sources="upload", type="filepath", label="Audio file"),
|
118 |
# gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
|
119 |
+
# gr.Checkbox(label="Use API", value=False) # Checkbox for API usage
|
120 |
],
|
121 |
outputs=[ gr.Textbox(label="Transcribed Text", type="text"),
|
122 |
gr.Textbox(label="Time taken", type="text"),
|
notes.txt
CHANGED
@@ -116,3 +116,9 @@ transcription_request_duration_seconds - Duration of transcription requests in s
|
|
116 |
transcription_memory_usage_bytes - Memory used by the transcription function
|
117 |
ram_usage_percentage - Percentage of total RAM used by the transcription function
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
transcription_memory_usage_bytes - Memory used by the transcription function
|
117 |
ram_usage_percentage - Percentage of total RAM used by the transcription function
|
118 |
|
119 |
+
### Case study 4
|
120 |
+
docker build --build-arg HF_TOKEN=$HF_TOKEN -t mlops-cs4 .
|
121 |
+
docker tag mlops-cs4 venkateshroshan/mlops-cs4:latest
|
122 |
+
sudo docker push venkateshroshan/mlops-cs4:latest
|
123 |
+
docker pull venkateshroshan/mlops-cs4:latest
|
124 |
+
docker run -d -p 7860:7860 -p 8001:8000 -p 9100:9100 venkateshroshan/mlops-cs4:latest
|