readmeupdated
Browse files- Dockerfile +5 -5
- apo.py +0 -18
Dockerfile
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
-
# Use a base image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Set the working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Install
|
8 |
RUN apt-get update && \
|
9 |
-
apt-get install -y ffmpeg && \
|
10 |
rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
-
# Copy
|
13 |
COPY . .
|
14 |
|
15 |
# Install Python dependencies
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
-
# Expose the
|
19 |
EXPOSE 7860
|
20 |
|
21 |
# Set the default command to run the application
|
|
|
1 |
+
# Use a base image with Python
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Set the working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Install system dependencies required for PyAudio and ffmpeg
|
8 |
RUN apt-get update && \
|
9 |
+
apt-get install -y python3-dev portaudio19-dev gcc ffmpeg && \
|
10 |
rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
+
# Copy application files into the container
|
13 |
COPY . .
|
14 |
|
15 |
# Install Python dependencies
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# Expose the necessary port (modify if needed)
|
19 |
EXPOSE 7860
|
20 |
|
21 |
# Set the default command to run the application
|
apo.py
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import requests
|
3 |
-
|
4 |
-
API_URL="http://localhost:8000/audios/record"
|
5 |
-
|
6 |
-
st.title("Speech To Text Testing ")
|
7 |
-
st.write("Click 'Start Recording' to capture and transcribe speech.")
|
8 |
-
|
9 |
-
if st.button("Start Recording"):
|
10 |
-
with st.spinner("Recording... Speak now."):
|
11 |
-
response = requests.get(API_URL)
|
12 |
-
if response.status_code == 200:
|
13 |
-
st.success("Recording complete!")
|
14 |
-
st.write("### Transcription:")
|
15 |
-
st.write(response.json()["transcription"])
|
16 |
-
else:
|
17 |
-
st.error("Error recording audio")
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|