Spaces:
Running
Running
Ilyas KHIAT
commited on
Commit
·
b3efaf6
1
Parent(s):
7220677
config
Browse files- .streamlit/config.toml +1 -1
- app.py +10 -0
- utils/audit/transcript_audio.py +1 -0
.streamlit/config.toml
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
[server]
|
2 |
-
maxUploadSize =
|
3 |
|
4 |
[theme]
|
5 |
base="light"
|
|
|
1 |
[server]
|
2 |
+
maxUploadSize = 20
|
3 |
|
4 |
[theme]
|
5 |
base="light"
|
app.py
CHANGED
@@ -2,6 +2,9 @@ import streamlit as st
|
|
2 |
import pymupdf as fitz
|
3 |
import pyperclip
|
4 |
from utils.audit.audit_doc import audit_descriptif
|
|
|
|
|
|
|
5 |
|
6 |
# Function to extract text from PDF
|
7 |
def extract_text_from_pdf(file):
|
@@ -29,6 +32,7 @@ def classify_file(file):
|
|
29 |
return "unknown"
|
30 |
|
31 |
def main():
|
|
|
32 |
# Streamlit app
|
33 |
st.title("AUDIT DES DOCUMENTS")
|
34 |
|
@@ -90,6 +94,12 @@ def main():
|
|
90 |
# st.success("Text copied to clipboard successfully!")
|
91 |
# else:
|
92 |
# st.info("Please upload a PDF file to extract text.")
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
if __name__ == "__main__":
|
95 |
main()
|
|
|
2 |
import pymupdf as fitz
|
3 |
import pyperclip
|
4 |
from utils.audit.audit_doc import audit_descriptif
|
5 |
+
import dotenv
|
6 |
+
from utils.audit.audit_audio import evaluate_audio_quality
|
7 |
+
|
8 |
|
9 |
# Function to extract text from PDF
|
10 |
def extract_text_from_pdf(file):
|
|
|
32 |
return "unknown"
|
33 |
|
34 |
def main():
|
35 |
+
dotenv.load_dotenv()
|
36 |
# Streamlit app
|
37 |
st.title("AUDIT DES DOCUMENTS")
|
38 |
|
|
|
94 |
# st.success("Text copied to clipboard successfully!")
|
95 |
# else:
|
96 |
# st.info("Please upload a PDF file to extract text.")
|
97 |
+
|
98 |
+
elif type == "audio":
|
99 |
+
with st.spinner("Analyzing audio quality..."):
|
100 |
+
audio_quality = evaluate_audio_quality(uploaded_file)
|
101 |
+
st.write("### Audio Quality")
|
102 |
+
st.write(f"Audio quality:\n {audio_quality}")
|
103 |
|
104 |
if __name__ == "__main__":
|
105 |
main()
|
utils/audit/transcript_audio.py
CHANGED
@@ -7,4 +7,5 @@ def transcript_audio(audio_file):
|
|
7 |
model="whisper",
|
8 |
file=audio_file
|
9 |
)
|
|
|
10 |
return transcription.text
|
|
|
7 |
model="whisper",
|
8 |
file=audio_file
|
9 |
)
|
10 |
+
|
11 |
return transcription.text
|