Spaces:
Sleeping
Sleeping
Commit
·
a105247
1
Parent(s):
d4cbaf8
initial
Browse files- Basic.py +36 -0
- MinuteBot.py +30 -0
- MinuteBotNA.py +35 -0
- packages.txt +1 -0
- procfile +1 -0
- requirements.txt +195 -0
- setup.sh +8 -0
Basic.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import whisper
|
| 3 |
+
from tempfile import NamedTemporaryFile
|
| 4 |
+
import ffmpeg
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
st.title("Whisper App")
|
| 8 |
+
|
| 9 |
+
# upload audio file with streamlit
|
| 10 |
+
audio_file = st.file_uploader("Upload Meeting Audio", type=["mp3"])
|
| 11 |
+
|
| 12 |
+
# model = whisper.load_model("base") # loading the base model
|
| 13 |
+
st.text("Whisper Model Loaded")
|
| 14 |
+
|
| 15 |
+
def load_whisper_model():
|
| 16 |
+
|
| 17 |
+
return model
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
if st.sidebar.button("Transcribe Audio"):
|
| 21 |
+
if audio_file is not None:
|
| 22 |
+
with NamedTemporaryFile(suffix="mp3") as temp:
|
| 23 |
+
temp.write(audio_file.getvalue())
|
| 24 |
+
temp.seek(0)
|
| 25 |
+
model = whisper.load_model("base")
|
| 26 |
+
result = model.transcribe(temp.name)
|
| 27 |
+
st.write(result["text"])
|
| 28 |
+
# st.sidebar.success("Transcribing Audio")
|
| 29 |
+
# transcription = model.transcribe(audio_file.name)
|
| 30 |
+
# st.sidebar.success("Transcription Complete")
|
| 31 |
+
# st.markdown(transcription["text"])
|
| 32 |
+
# else:
|
| 33 |
+
# st.sidebar.error("Please upload an audio file")
|
| 34 |
+
|
| 35 |
+
st.sidebar.header("Play Original Audio File")
|
| 36 |
+
st.sidebar.audio(audio_file)
|
MinuteBot.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import whisper
|
| 3 |
+
from tempfile import NamedTemporaryFile
|
| 4 |
+
import ffmpeg
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
st.title("MinuteBot App")
|
| 8 |
+
|
| 9 |
+
# upload audio file with streamlit
|
| 10 |
+
audio_file = st.file_uploader("Unggah Meeting Audio", type=["mp3", "wav"])
|
| 11 |
+
|
| 12 |
+
# model = whisper.load_model("base") # loading the base model
|
| 13 |
+
st.text("MinuteBot Model telah dimuat:")
|
| 14 |
+
|
| 15 |
+
def load_whisper_model():
|
| 16 |
+
|
| 17 |
+
return model
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
if st.sidebar.button("Transkripsikan Audio"):
|
| 21 |
+
if audio_file is not None:
|
| 22 |
+
with NamedTemporaryFile() as temp:
|
| 23 |
+
temp.write(audio_file.getvalue())
|
| 24 |
+
temp.seek(0)
|
| 25 |
+
model = whisper.load_model("large")
|
| 26 |
+
result = model.transcribe(temp.name)
|
| 27 |
+
st.write(result["text"])
|
| 28 |
+
|
| 29 |
+
st.sidebar.header("Putar Berkas Audio")
|
| 30 |
+
st.sidebar.audio(audio_file)
|
MinuteBotNA.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import whisper
|
| 3 |
+
from tempfile import NamedTemporaryFile
|
| 4 |
+
import ffmpeg
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
st.title("Whisper App")
|
| 8 |
+
|
| 9 |
+
# upload audio file with streamlit
|
| 10 |
+
audio_file = st.file_uploader("Upload Meeting Audio", type=["m4a", "mp3", "wav"])
|
| 11 |
+
|
| 12 |
+
st.text("Whisper Model Loaded")
|
| 13 |
+
|
| 14 |
+
def load_whisper_model():
|
| 15 |
+
|
| 16 |
+
return model
|
| 17 |
+
|
| 18 |
+
def convert_m4a_to_mp3(input_path, output_path):
|
| 19 |
+
audio = AudioSegment.from_file(input_path, format="m4a")
|
| 20 |
+
audio.export(output_path, format="mp3")
|
| 21 |
+
|
| 22 |
+
if st.sidebar.button("Transcribe Audio"):
|
| 23 |
+
if audio_file is not None:
|
| 24 |
+
with NamedTemporaryFile(suffix="mp3") as temp:
|
| 25 |
+
temp.write(audio_file.getvalue())
|
| 26 |
+
temp.seek(0)
|
| 27 |
+
model = whisper.load_model("base")
|
| 28 |
+
temp_mp3_path = temp.name
|
| 29 |
+
convert_m4a_to_mp3(audio_file, temp_mp3_path)
|
| 30 |
+
result = model.transcribe(temp_mp3_path)
|
| 31 |
+
st.write(result["text"])
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
st.sidebar.header("Play Original Audio File")
|
| 35 |
+
st.sidebar.audio(audio_file)
|
packages.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
ffmpeg
|
procfile
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
|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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
aiofiles==23.1.0
|
| 2 |
+
aiohttp==3.8.4
|
| 3 |
+
aiosignal==1.3.1
|
| 4 |
+
altair==5.0.1
|
| 5 |
+
anyio==3.7.0
|
| 6 |
+
appnope==0.1.3
|
| 7 |
+
asttokens==2.2.1
|
| 8 |
+
async-timeout==4.0.2
|
| 9 |
+
attrs==23.1.0
|
| 10 |
+
backcall==0.2.0
|
| 11 |
+
backoff==2.2.1
|
| 12 |
+
bardapi==0.1.26
|
| 13 |
+
bcrypt==4.0.1
|
| 14 |
+
beautifulsoup4==4.12.2
|
| 15 |
+
blinker==1.6.2
|
| 16 |
+
browser-cookie3==0.19.1
|
| 17 |
+
cachetools==4.2.4
|
| 18 |
+
certifi==2023.5.7
|
| 19 |
+
charset-normalizer==3.1.0
|
| 20 |
+
chromadb==0.3.25
|
| 21 |
+
click==8.1.3
|
| 22 |
+
clickhouse-connect==0.5.25
|
| 23 |
+
colorama==0.4.6
|
| 24 |
+
coloredlogs==15.0.1
|
| 25 |
+
comm==0.1.3
|
| 26 |
+
contourpy==1.1.0
|
| 27 |
+
cycler==0.11.0
|
| 28 |
+
dataclasses-json==0.5.7
|
| 29 |
+
datasets==2.13.1
|
| 30 |
+
debugpy==1.6.7
|
| 31 |
+
decorator==5.1.1
|
| 32 |
+
deep-translator==1.11.4
|
| 33 |
+
deta==1.2.0
|
| 34 |
+
dill==0.3.6
|
| 35 |
+
docopt==0.6.2
|
| 36 |
+
duckdb==0.8.0
|
| 37 |
+
exceptiongroup==1.1.1
|
| 38 |
+
executing==1.2.0
|
| 39 |
+
extra-streamlit-components==0.1.56
|
| 40 |
+
faiss-cpu==1.7.4
|
| 41 |
+
fastapi==0.96.0
|
| 42 |
+
ffmpy==0.3.0
|
| 43 |
+
ffmpeg-python==0.2.0
|
| 44 |
+
filelock==3.12.0
|
| 45 |
+
flatbuffers==23.5.26
|
| 46 |
+
fonttools==4.41.0
|
| 47 |
+
frozenlist==1.3.3
|
| 48 |
+
fsspec==2023.5.0
|
| 49 |
+
gitdb==4.0.10
|
| 50 |
+
GitPython==3.1.31
|
| 51 |
+
google-api-core==1.34.0
|
| 52 |
+
google-auth==1.35.0
|
| 53 |
+
google-cloud-core==1.7.3
|
| 54 |
+
google-cloud-translate==2.0.1
|
| 55 |
+
googleapis-common-protos==1.59.1
|
| 56 |
+
gradio==3.38.0
|
| 57 |
+
gradio_client==0.2.10
|
| 58 |
+
grpcio==1.56.0
|
| 59 |
+
grpcio-status==1.48.2
|
| 60 |
+
h11==0.14.0
|
| 61 |
+
h2==4.1.0
|
| 62 |
+
hnswlib==0.7.0
|
| 63 |
+
hpack==4.0.0
|
| 64 |
+
httpcore==0.17.3
|
| 65 |
+
httptools==0.5.0
|
| 66 |
+
httpx==0.24.1
|
| 67 |
+
huggingface-hub==0.15.1
|
| 68 |
+
humanfriendly==10.0
|
| 69 |
+
hyperframe==6.0.1
|
| 70 |
+
idna==3.4
|
| 71 |
+
importlib-metadata==6.6.0
|
| 72 |
+
InstructorEmbedding==1.0.1
|
| 73 |
+
ipykernel==6.24.0
|
| 74 |
+
ipython==8.14.0
|
| 75 |
+
jedi==0.18.2
|
| 76 |
+
Jinja2==3.1.2
|
| 77 |
+
joblib==1.2.0
|
| 78 |
+
jsonschema==4.17.3
|
| 79 |
+
jupyter_client==8.3.0
|
| 80 |
+
jupyter_core==5.3.1
|
| 81 |
+
kiwisolver==1.4.4
|
| 82 |
+
langchain==0.0.189
|
| 83 |
+
linkify-it-py==2.0.2
|
| 84 |
+
lz4==4.3.2
|
| 85 |
+
markdown-it-py==2.2.0
|
| 86 |
+
MarkupSafe==2.1.3
|
| 87 |
+
marshmallow==3.19.0
|
| 88 |
+
marshmallow-enum==1.5.1
|
| 89 |
+
matplotlib==3.7.2
|
| 90 |
+
matplotlib-inline==0.1.6
|
| 91 |
+
mdit-py-plugins==0.3.3
|
| 92 |
+
mdurl==0.1.2
|
| 93 |
+
monotonic==1.6
|
| 94 |
+
mpmath==1.3.0
|
| 95 |
+
multidict==6.0.4
|
| 96 |
+
multiprocess==0.70.14
|
| 97 |
+
mypy-extensions==1.0.0
|
| 98 |
+
nest-asyncio==1.5.6
|
| 99 |
+
networkx==3.1
|
| 100 |
+
nltk==3.8.1
|
| 101 |
+
numexpr==2.8.4
|
| 102 |
+
numpy==1.24.3
|
| 103 |
+
onnxruntime==1.15.0
|
| 104 |
+
openai==0.27.7
|
| 105 |
+
openapi-schema-pydantic==1.2.4
|
| 106 |
+
orjson==3.9.2
|
| 107 |
+
overrides==7.3.1
|
| 108 |
+
packaging==23.1
|
| 109 |
+
pandas==2.0.2
|
| 110 |
+
parso==0.8.3
|
| 111 |
+
pexpect==4.8.0
|
| 112 |
+
pickleshare==0.7.5
|
| 113 |
+
Pillow==9.5.0
|
| 114 |
+
pipreqs==0.4.13
|
| 115 |
+
platformdirs==3.9.1
|
| 116 |
+
posthog==3.0.1
|
| 117 |
+
prompt-toolkit==3.0.39
|
| 118 |
+
protobuf==3.20.3
|
| 119 |
+
psutil==5.9.5
|
| 120 |
+
ptyprocess==0.7.0
|
| 121 |
+
pure-eval==0.2.2
|
| 122 |
+
pyarrow==12.0.0
|
| 123 |
+
pyasn1==0.5.0
|
| 124 |
+
pyasn1-modules==0.3.0
|
| 125 |
+
pycryptodomex==3.18.0
|
| 126 |
+
pydantic==1.10.8
|
| 127 |
+
pydeck==0.8.1b0
|
| 128 |
+
pydub==0.25.1
|
| 129 |
+
Pygments==2.15.1
|
| 130 |
+
PyJWT==2.8.0
|
| 131 |
+
Pympler==1.0.1
|
| 132 |
+
pyparsing==3.0.9
|
| 133 |
+
pypdf==3.9.0
|
| 134 |
+
PyPDF2==3.0.1
|
| 135 |
+
pyrsistent==0.19.3
|
| 136 |
+
python-dateutil==2.8.2
|
| 137 |
+
python-dotenv==1.0.0
|
| 138 |
+
python-multipart==0.0.6
|
| 139 |
+
pytz==2023.3
|
| 140 |
+
pytz-deprecation-shim==0.1.0.post0
|
| 141 |
+
PyYAML==6.0
|
| 142 |
+
pyzmq==25.1.0
|
| 143 |
+
regex==2023.6.3
|
| 144 |
+
requests==2.31.0
|
| 145 |
+
rich==13.4.1
|
| 146 |
+
rsa==4.9
|
| 147 |
+
scale-llm-engine==0.0.0b5
|
| 148 |
+
scikit-learn==1.2.2
|
| 149 |
+
scipy==1.10.1
|
| 150 |
+
semantic-version==2.10.0
|
| 151 |
+
sentence-transformers==2.2.2
|
| 152 |
+
sentencepiece==0.1.99
|
| 153 |
+
six==1.16.0
|
| 154 |
+
smart-open==6.3.0
|
| 155 |
+
smmap==5.0.0
|
| 156 |
+
sniffio==1.3.0
|
| 157 |
+
soupsieve==2.4.1
|
| 158 |
+
SQLAlchemy==2.0.15
|
| 159 |
+
stack-data==0.6.2
|
| 160 |
+
starlette==0.27.0
|
| 161 |
+
streamlit==1.24.1
|
| 162 |
+
streamlit-authenticator==0.2.2
|
| 163 |
+
streamlit-chat==0.1.1
|
| 164 |
+
sympy==1.12
|
| 165 |
+
tabulate==0.9.0
|
| 166 |
+
tenacity==8.2.2
|
| 167 |
+
threadpoolctl==3.1.0
|
| 168 |
+
tiktoken==0.3.1
|
| 169 |
+
tokenizers==0.13.3
|
| 170 |
+
toml==0.10.2
|
| 171 |
+
toolz==0.12.0
|
| 172 |
+
torch==2.0.1
|
| 173 |
+
torchvision==0.15.2
|
| 174 |
+
tornado==6.3.2
|
| 175 |
+
tqdm==4.65.0
|
| 176 |
+
traitlets==5.9.0
|
| 177 |
+
transformers==4.29.2
|
| 178 |
+
typing-inspect==0.9.0
|
| 179 |
+
typing_extensions==4.6.3
|
| 180 |
+
tzdata==2023.3
|
| 181 |
+
tzlocal==4.3
|
| 182 |
+
uc-micro-py==1.0.2
|
| 183 |
+
urllib3==2.0.2
|
| 184 |
+
uvicorn==0.22.0
|
| 185 |
+
uvloop==0.17.0
|
| 186 |
+
validators==0.20.0
|
| 187 |
+
watchfiles==0.19.0
|
| 188 |
+
wcwidth==0.2.6
|
| 189 |
+
websockets==11.0.3
|
| 190 |
+
xxhash==3.2.0
|
| 191 |
+
yarg==0.1.9
|
| 192 |
+
yarl==1.9.2
|
| 193 |
+
zipp==3.15.0
|
| 194 |
+
zstandard==0.21.0
|
| 195 |
+
openai-whisper==20230314
|
setup.sh
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mkdir -p ~/.streamlit/
|
| 2 |
+
echo "\
|
| 3 |
+
[server]\n\
|
| 4 |
+
headless = true\n\
|
| 5 |
+
port = $PORT\n\
|
| 6 |
+
enableCORS = false\n\
|
| 7 |
+
\n\
|
| 8 |
+
" > ~/.streamlit/config.toml
|