Spaces:
Build error
Build error
Upload folder using huggingface_hub
Browse files
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
---
|
| 2 |
title: EwMeetingNotes
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 4.12.0
|
| 8 |
app_file: app.py
|
|
|
|
| 1 |
---
|
| 2 |
title: EwMeetingNotes
|
| 3 |
+
emoji: 🏢
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 4.12.0
|
| 8 |
app_file: app.py
|
app.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import whisper
|
| 3 |
+
# Use a pipeline as a high-level helper
|
| 4 |
+
from transformers import pipeline
|
| 5 |
+
from datetime import timedelta
|
| 6 |
+
|
| 7 |
+
model_size = "medium"
|
| 8 |
+
model = whisper.load_model(model_size)
|
| 9 |
+
summarizer_pipe = pipeline('summarization', model="sshleifer/distilbart-cnn-12-6")
|
| 10 |
+
|
| 11 |
+
def format_seconds(seconds):
|
| 12 |
+
# Create a timedelta object with the given seconds
|
| 13 |
+
delta = timedelta(seconds=seconds)
|
| 14 |
+
|
| 15 |
+
# Format the timedelta as a string in the desired format
|
| 16 |
+
formatted_time = str(delta)
|
| 17 |
+
|
| 18 |
+
# Extract hours, minutes, and seconds
|
| 19 |
+
hours, remainder = divmod(delta.seconds, 3600)
|
| 20 |
+
minutes, seconds = divmod(remainder, 60)
|
| 21 |
+
|
| 22 |
+
# Format milliseconds with three decimal places
|
| 23 |
+
# milliseconds = int(delta.microseconds / 1000)
|
| 24 |
+
|
| 25 |
+
# Create the final formatted string
|
| 26 |
+
formatted_string = "{:02}:{:02}:{:02}".format(hours, minutes, seconds)
|
| 27 |
+
|
| 28 |
+
return formatted_string
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def process_meeting_video(mp3_path):
|
| 32 |
+
transcription = model.transcribe(mp3_path, word_timestamps=True)
|
| 33 |
+
transcript_text = ""
|
| 34 |
+
for segment in transcription["segments"]:
|
| 35 |
+
start = segment['start']
|
| 36 |
+
end = segment['end']
|
| 37 |
+
text = segment['text']
|
| 38 |
+
if start == 0.0000:
|
| 39 |
+
startTime = "00:00:00"
|
| 40 |
+
else:
|
| 41 |
+
startTime = format_seconds(start)
|
| 42 |
+
endTime = format_seconds(end)
|
| 43 |
+
transcript_text += (f"[{startTime}->{endTime}] {text}\n")
|
| 44 |
+
|
| 45 |
+
summary_output = summarizer_pipe(transcription["text"])[0]['summary_text']
|
| 46 |
+
return transcript_text,summary_output
|
| 47 |
+
|
| 48 |
+
summary_box = gr.Textbox(label="Summary", lines=10)
|
| 49 |
+
transcription_box = gr.Textbox(label="Transcript", lines=30)
|
| 50 |
+
demo = gr.Interface(process_meeting_video,
|
| 51 |
+
inputs=gr.File(),
|
| 52 |
+
outputs=[transcription_box, summary_box],
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
if __name__ == "__main__":
|
| 56 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
absl-py==2.0.0
|
| 2 |
+
accelerate==0.24.1
|
| 3 |
+
aiofiles==23.2.1
|
| 4 |
+
aiohttp==3.8.6
|
| 5 |
+
aiosignal==1.3.1
|
| 6 |
+
altair==5.1.2
|
| 7 |
+
annotated-types==0.6.0
|
| 8 |
+
anyio==3.7.1
|
| 9 |
+
appnope==0.1.3
|
| 10 |
+
argon2-cffi==23.1.0
|
| 11 |
+
argon2-cffi-bindings==21.2.0
|
| 12 |
+
arrow==1.3.0
|
| 13 |
+
asttokens==2.4.1
|
| 14 |
+
async-lru==2.0.4
|
| 15 |
+
async-timeout==4.0.3
|
| 16 |
+
attrs==23.1.0
|
| 17 |
+
audioread==3.0.1
|
| 18 |
+
Babel==2.13.1
|
| 19 |
+
backcall==0.2.0
|
| 20 |
+
beautifulsoup4==4.12.2
|
| 21 |
+
bleach==6.1.0
|
| 22 |
+
blis==0.7.11
|
| 23 |
+
cachetools==5.3.2
|
| 24 |
+
catalogue==2.0.10
|
| 25 |
+
certifi==2023.7.22
|
| 26 |
+
cffi==1.16.0
|
| 27 |
+
charset-normalizer==3.3.0
|
| 28 |
+
click==8.1.7
|
| 29 |
+
cloudpathlib==0.16.0
|
| 30 |
+
colorama==0.4.6
|
| 31 |
+
comm==0.1.4
|
| 32 |
+
confection==0.1.4
|
| 33 |
+
contourpy==1.1.1
|
| 34 |
+
cycler==0.12.1
|
| 35 |
+
cymem==2.0.8
|
| 36 |
+
datasets==2.14.6
|
| 37 |
+
debugpy==1.8.0
|
| 38 |
+
decorator==5.1.1
|
| 39 |
+
deepmultilingualpunctuation==1.0.1
|
| 40 |
+
defusedxml==0.7.1
|
| 41 |
+
dill==0.3.7
|
| 42 |
+
distro==1.9.0
|
| 43 |
+
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl#sha256=86cc141f63942d4b2c5fcee06630fd6f904788d2f0ab005cce45aadb8fb73889
|
| 44 |
+
evaluate==0.4.1
|
| 45 |
+
executing==2.0.0
|
| 46 |
+
fastapi==0.104.1
|
| 47 |
+
fastjsonschema==2.18.1
|
| 48 |
+
ffmpy==0.3.1
|
| 49 |
+
filelock==3.12.4
|
| 50 |
+
fonttools==4.43.1
|
| 51 |
+
fqdn==1.5.1
|
| 52 |
+
frozenlist==1.4.0
|
| 53 |
+
fsspec==2023.9.2
|
| 54 |
+
google-auth==2.23.4
|
| 55 |
+
google-auth-oauthlib==1.1.0
|
| 56 |
+
gradio==4.0.2
|
| 57 |
+
gradio_client==0.7.0
|
| 58 |
+
grpcio==1.59.2
|
| 59 |
+
h11==0.14.0
|
| 60 |
+
httpcore==0.18.0
|
| 61 |
+
httpx==0.25.0
|
| 62 |
+
huggingface-hub==0.19.4
|
| 63 |
+
idna==3.4
|
| 64 |
+
importlib-resources==6.1.0
|
| 65 |
+
ipykernel==6.26.0
|
| 66 |
+
ipython==8.16.1
|
| 67 |
+
ipywidgets==8.1.1
|
| 68 |
+
isoduration==20.11.0
|
| 69 |
+
jedi==0.19.1
|
| 70 |
+
Jinja2==3.1.2
|
| 71 |
+
jiwer==3.0.3
|
| 72 |
+
joblib==1.3.2
|
| 73 |
+
json5==0.9.14
|
| 74 |
+
jsonpointer==2.4
|
| 75 |
+
jsonschema==4.19.1
|
| 76 |
+
jsonschema-specifications==2023.7.1
|
| 77 |
+
jupyter-events==0.8.0
|
| 78 |
+
jupyter-lsp==2.2.0
|
| 79 |
+
jupyter_client==8.5.0
|
| 80 |
+
jupyter_core==5.4.0
|
| 81 |
+
jupyter_server==2.9.1
|
| 82 |
+
jupyter_server_terminals==0.4.4
|
| 83 |
+
jupyterlab==4.0.7
|
| 84 |
+
jupyterlab-pygments==0.2.2
|
| 85 |
+
jupyterlab-widgets==3.0.9
|
| 86 |
+
jupyterlab_server==2.25.0
|
| 87 |
+
kiwisolver==1.4.5
|
| 88 |
+
langcodes==3.3.0
|
| 89 |
+
lazy_loader==0.3
|
| 90 |
+
librosa==0.10.1
|
| 91 |
+
llvmlite==0.41.0
|
| 92 |
+
lxml==4.9.3
|
| 93 |
+
Markdown==3.5.1
|
| 94 |
+
markdown-it-py==3.0.0
|
| 95 |
+
MarkupSafe==2.1.3
|
| 96 |
+
matplotlib==3.8.1
|
| 97 |
+
matplotlib-inline==0.1.6
|
| 98 |
+
mdurl==0.1.2
|
| 99 |
+
mistune==3.0.2
|
| 100 |
+
more-itertools==10.1.0
|
| 101 |
+
mpmath==1.3.0
|
| 102 |
+
msgpack==1.0.7
|
| 103 |
+
multidict==6.0.4
|
| 104 |
+
multiprocess==0.70.15
|
| 105 |
+
murmurhash==1.0.10
|
| 106 |
+
nbclient==0.8.0
|
| 107 |
+
nbconvert==7.9.2
|
| 108 |
+
nbformat==5.9.2
|
| 109 |
+
nest-asyncio==1.5.8
|
| 110 |
+
networkx==3.1
|
| 111 |
+
nltk==3.8.1
|
| 112 |
+
notebook_shim==0.2.3
|
| 113 |
+
numba==0.58.0
|
| 114 |
+
numpy==1.25.2
|
| 115 |
+
oauthlib==3.2.2
|
| 116 |
+
openai==1.6.1
|
| 117 |
+
openai-whisper @ git+https://github.com/openai/whisper.git@e58f28804528831904c3b6f2c0e473f346223433
|
| 118 |
+
orjson==3.9.10
|
| 119 |
+
overrides==7.4.0
|
| 120 |
+
packaging==23.2
|
| 121 |
+
pandas==2.1.2
|
| 122 |
+
pandocfilters==1.5.0
|
| 123 |
+
parso==0.8.3
|
| 124 |
+
pexpect==4.8.0
|
| 125 |
+
pickleshare==0.7.5
|
| 126 |
+
Pillow==10.1.0
|
| 127 |
+
platformdirs==3.11.0
|
| 128 |
+
pooch==1.8.0
|
| 129 |
+
portalocker==2.8.2
|
| 130 |
+
preshed==3.0.9
|
| 131 |
+
prometheus-client==0.17.1
|
| 132 |
+
prompt-toolkit==3.0.39
|
| 133 |
+
protobuf==4.23.4
|
| 134 |
+
psutil==5.9.6
|
| 135 |
+
ptyprocess==0.7.0
|
| 136 |
+
pure-eval==0.2.2
|
| 137 |
+
pyarrow==14.0.0
|
| 138 |
+
pyasn1==0.5.0
|
| 139 |
+
pyasn1-modules==0.3.0
|
| 140 |
+
pycparser==2.21
|
| 141 |
+
pydantic==2.4.2
|
| 142 |
+
pydantic_core==2.10.1
|
| 143 |
+
pydub==0.25.1
|
| 144 |
+
Pygments==2.16.1
|
| 145 |
+
pyparsing==3.1.1
|
| 146 |
+
pysubs2==1.6.1
|
| 147 |
+
python-dateutil==2.8.2
|
| 148 |
+
python-json-logger==2.0.7
|
| 149 |
+
python-multipart==0.0.6
|
| 150 |
+
pytube==15.0.0
|
| 151 |
+
pytz==2023.3.post1
|
| 152 |
+
PyYAML==6.0.1
|
| 153 |
+
pyzmq==25.1.1
|
| 154 |
+
rapidfuzz==3.5.1
|
| 155 |
+
referencing==0.30.2
|
| 156 |
+
regex==2023.10.3
|
| 157 |
+
requests==2.31.0
|
| 158 |
+
requests-oauthlib==1.3.1
|
| 159 |
+
responses==0.18.0
|
| 160 |
+
rfc3339-validator==0.1.4
|
| 161 |
+
rfc3986-validator==0.1.1
|
| 162 |
+
rich==13.6.0
|
| 163 |
+
rpds-py==0.10.6
|
| 164 |
+
rsa==4.9
|
| 165 |
+
sacrebleu==2.4.0
|
| 166 |
+
safetensors==0.4.0
|
| 167 |
+
scikit-learn==1.3.2
|
| 168 |
+
scipy==1.11.3
|
| 169 |
+
semantic-version==2.10.0
|
| 170 |
+
Send2Trash==1.8.2
|
| 171 |
+
sentence-transformers==2.2.2
|
| 172 |
+
sentencepiece==0.1.99
|
| 173 |
+
shellingham==1.5.4
|
| 174 |
+
six==1.16.0
|
| 175 |
+
smart-open==6.4.0
|
| 176 |
+
sniffio==1.3.0
|
| 177 |
+
soundfile==0.12.1
|
| 178 |
+
soupsieve==2.5
|
| 179 |
+
soxr==0.3.7
|
| 180 |
+
spacy==3.7.2
|
| 181 |
+
spacy-legacy==3.0.12
|
| 182 |
+
spacy-loggers==1.0.5
|
| 183 |
+
srsly==2.4.8
|
| 184 |
+
stack-data==0.6.3
|
| 185 |
+
starlette==0.27.0
|
| 186 |
+
sympy==1.12
|
| 187 |
+
tabulate==0.9.0
|
| 188 |
+
tensorboard==2.15.0
|
| 189 |
+
tensorboard-data-server==0.7.2
|
| 190 |
+
terminado==0.17.1
|
| 191 |
+
thinc==8.2.2
|
| 192 |
+
threadpoolctl==3.2.0
|
| 193 |
+
tiktoken==0.3.3
|
| 194 |
+
tinycss2==1.2.1
|
| 195 |
+
tokenizers==0.15.0
|
| 196 |
+
tomlkit==0.12.0
|
| 197 |
+
toolz==0.12.0
|
| 198 |
+
torch==2.1.2
|
| 199 |
+
torchaudio==2.1.2
|
| 200 |
+
torchvision==0.16.2
|
| 201 |
+
tornado==6.3.3
|
| 202 |
+
tqdm==4.66.1
|
| 203 |
+
traitlets==5.12.0
|
| 204 |
+
transformers @ git+https://github.com/huggingface/transformers@35551f9a0f66a22de4971b4a51b3c172d3b87f95
|
| 205 |
+
typer==0.9.0
|
| 206 |
+
types-python-dateutil==2.8.19.14
|
| 207 |
+
typing_extensions==4.8.0
|
| 208 |
+
tzdata==2023.3
|
| 209 |
+
uri-template==1.3.0
|
| 210 |
+
urllib3==2.0.6
|
| 211 |
+
uvicorn==0.23.2
|
| 212 |
+
wasabi==1.1.2
|
| 213 |
+
wcwidth==0.2.8
|
| 214 |
+
weasel==0.3.4
|
| 215 |
+
webcolors==1.13
|
| 216 |
+
webencodings==0.5.1
|
| 217 |
+
websocket-client==1.6.4
|
| 218 |
+
websockets==11.0.3
|
| 219 |
+
Werkzeug==3.0.1
|
| 220 |
+
widgetsnbextension==4.0.9
|
| 221 |
+
xxhash==3.4.1
|
| 222 |
+
yarl==1.9.2
|