Spaces:
Sleeping
Sleeping
adeelshuaib
commited on
Commit
•
bcd4212
1
Parent(s):
248713a
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
# Importing necessary libraries
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
from speechbrain.pretrained import Tacotron2, HIFIGAN, EncoderDecoderASR
|
@@ -69,10 +68,19 @@ def audio_part(candidate_name, audio_responses):
|
|
69 |
plt.tight_layout()
|
70 |
return df, plt
|
71 |
|
72 |
-
# Gradio UI
|
73 |
-
def chat_interface(candidate_name,
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
text_df, text_plot = text_part(candidate_name, text_responses)
|
|
|
|
|
75 |
audio_df, audio_plot = audio_part(candidate_name, audio_responses)
|
|
|
76 |
return text_df, text_plot, audio_df, audio_plot
|
77 |
|
78 |
# Create text inputs and audio inputs
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
from speechbrain.pretrained import Tacotron2, HIFIGAN, EncoderDecoderASR
|
|
|
68 |
plt.tight_layout()
|
69 |
return df, plt
|
70 |
|
71 |
+
# Gradio UI function
|
72 |
+
def chat_interface(candidate_name, *responses):
|
73 |
+
# Separate text responses and audio responses
|
74 |
+
num_text_questions = len(text_questions)
|
75 |
+
text_responses = responses[:num_text_questions]
|
76 |
+
audio_responses = responses[num_text_questions:]
|
77 |
+
|
78 |
+
# Process text responses
|
79 |
text_df, text_plot = text_part(candidate_name, text_responses)
|
80 |
+
|
81 |
+
# Process audio responses
|
82 |
audio_df, audio_plot = audio_part(candidate_name, audio_responses)
|
83 |
+
|
84 |
return text_df, text_plot, audio_df, audio_plot
|
85 |
|
86 |
# Create text inputs and audio inputs
|