Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,10 @@
|
|
| 1 |
import os
|
| 2 |
-
#import re
|
| 3 |
-
#import functools
|
| 4 |
-
from functools import partial
|
| 5 |
-
|
| 6 |
-
#import requests
|
| 7 |
-
#import pandas as pd
|
| 8 |
-
|
| 9 |
import torch
|
| 10 |
import gradio as gr
|
| 11 |
from transformers import pipeline, Wav2Vec2ProcessorWithLM
|
| 12 |
from pyannote.audio import Pipeline
|
| 13 |
import whisperx
|
|
|
|
| 14 |
|
| 15 |
from utils import split
|
| 16 |
from utils import speech_to_text as stt
|
|
@@ -35,7 +29,7 @@ speech_to_text = partial(
|
|
| 35 |
whisper_device=whisper_device
|
| 36 |
)
|
| 37 |
|
| 38 |
-
#
|
| 39 |
emotion_pipeline = pipeline(
|
| 40 |
"text-classification",
|
| 41 |
model="bhadresh-savani/distilbert-base-uncased-emotion",
|
|
@@ -45,6 +39,7 @@ summarization_pipeline = pipeline(
|
|
| 45 |
model="knkarthick/MEETING_SUMMARY",
|
| 46 |
)
|
| 47 |
|
|
|
|
| 48 |
def summarize(diarized, summarization_pipeline):
|
| 49 |
text = ""
|
| 50 |
for d in diarized:
|
|
|
|
| 1 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import torch
|
| 3 |
import gradio as gr
|
| 4 |
from transformers import pipeline, Wav2Vec2ProcessorWithLM
|
| 5 |
from pyannote.audio import Pipeline
|
| 6 |
import whisperx
|
| 7 |
+
from functools import partial
|
| 8 |
|
| 9 |
from utils import split
|
| 10 |
from utils import speech_to_text as stt
|
|
|
|
| 29 |
whisper_device=whisper_device
|
| 30 |
)
|
| 31 |
|
| 32 |
+
# Get Transformer Models
|
| 33 |
emotion_pipeline = pipeline(
|
| 34 |
"text-classification",
|
| 35 |
model="bhadresh-savani/distilbert-base-uncased-emotion",
|
|
|
|
| 39 |
model="knkarthick/MEETING_SUMMARY",
|
| 40 |
)
|
| 41 |
|
| 42 |
+
# Apply models to transcripts
|
| 43 |
def summarize(diarized, summarization_pipeline):
|
| 44 |
text = ""
|
| 45 |
for d in diarized:
|