Spaces:
Running
Running
add new examples
Browse files- src/content/common.py +40 -3
- src/content/playground.py +1 -1
- src/tunnel.py +7 -3
src/content/common.py
CHANGED
@@ -69,6 +69,42 @@ MODEL_NAMES = OrderedDict({})
|
|
69 |
|
70 |
|
71 |
AUDIO_SAMPLES_W_INSTRUCT = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
"7_ASR_IMDA_PART3_30_ASR_v2_2269": {
|
73 |
"apperance": "7. Automatic Speech Recognition task: conversation in Singapore accent",
|
74 |
"instructions": [
|
@@ -415,8 +451,8 @@ def header_section(component_name, description="", concise_description="", icon=
|
|
415 |
def sidebar_fragment():
|
416 |
with st.container(height=256, border=False):
|
417 |
st.page_link("pages/playground.py", disabled=st.session_state.disprompt, label="π Playground")
|
418 |
-
st.page_link("pages/agent.py", disabled=st.session_state.disprompt, label="π₯
|
419 |
-
st.page_link("pages/voice_chat.py", disabled=st.session_state.disprompt, label="π£οΈ Voice Chat")
|
420 |
|
421 |
st.divider()
|
422 |
|
@@ -446,7 +482,8 @@ def successful_example_section(audio_sample_names, audio_array_state, audio_base
|
|
446 |
key='select')
|
447 |
|
448 |
if sample_name and st.session_state.on_select:
|
449 |
-
|
|
|
450 |
st.session_state.update(
|
451 |
on_select=False,
|
452 |
new_prompt=AUDIO_SAMPLES_W_INSTRUCT[sample_name]["instructions"][0]
|
|
|
69 |
|
70 |
|
71 |
AUDIO_SAMPLES_W_INSTRUCT = {
|
72 |
+
"female_pilot#1": {
|
73 |
+
"apperance": "Female Pilot Interview: Transcription",
|
74 |
+
"instructions": [
|
75 |
+
"Please transcribe the speech"
|
76 |
+
]
|
77 |
+
},
|
78 |
+
"female_pilot#2": {
|
79 |
+
"apperance": "Female Pilot Interview: Aircraft name",
|
80 |
+
"instructions": [
|
81 |
+
"What does 倧ε士 mean in the conversation"
|
82 |
+
]
|
83 |
+
},
|
84 |
+
"female_pilot#3": {
|
85 |
+
"apperance": "Female Pilot Interview: Air Force Personnel Count",
|
86 |
+
"instructions": [
|
87 |
+
"How many air force personnel are there?"
|
88 |
+
]
|
89 |
+
},
|
90 |
+
"female_pilot#4": {
|
91 |
+
"apperance": "Female Pilot Interview: Air Force Personnel Name",
|
92 |
+
"instructions": [
|
93 |
+
"Can you tell me the names of the two pilots?"
|
94 |
+
]
|
95 |
+
},
|
96 |
+
"female_pilot#5": {
|
97 |
+
"apperance": "Female Pilot Interview: Pilot Seat Restriction",
|
98 |
+
"instructions": [
|
99 |
+
"What is the concern of having a big butt for pilot?"
|
100 |
+
]
|
101 |
+
},
|
102 |
+
"female_pilot#6": {
|
103 |
+
"apperance": "Female Pilot Interview: Conversation Mood",
|
104 |
+
"instructions": [
|
105 |
+
"What is the mood of the conversation?"
|
106 |
+
]
|
107 |
+
},
|
108 |
"7_ASR_IMDA_PART3_30_ASR_v2_2269": {
|
109 |
"apperance": "7. Automatic Speech Recognition task: conversation in Singapore accent",
|
110 |
"instructions": [
|
|
|
451 |
def sidebar_fragment():
|
452 |
with st.container(height=256, border=False):
|
453 |
st.page_link("pages/playground.py", disabled=st.session_state.disprompt, label="π Playground")
|
454 |
+
st.page_link("pages/agent.py", disabled=st.session_state.disprompt, label="π₯ Cascade System")
|
455 |
+
st.page_link("pages/voice_chat.py", disabled=st.session_state.disprompt, label="π£οΈ End-to-End Voice Chat")
|
456 |
|
457 |
st.divider()
|
458 |
|
|
|
482 |
key='select')
|
483 |
|
484 |
if sample_name and st.session_state.on_select:
|
485 |
+
file_name = sample_name.split("#")[0]
|
486 |
+
audio_bytes = open(f"audio_samples/{file_name}.wav", "rb").read()
|
487 |
st.session_state.update(
|
488 |
on_select=False,
|
489 |
new_prompt=AUDIO_SAMPLES_W_INSTRUCT[sample_name]["instructions"][0]
|
src/content/playground.py
CHANGED
@@ -24,7 +24,7 @@ QUICK_ACTIONS = [
|
|
24 |
},
|
25 |
{
|
26 |
"name": "**Transcript**",
|
27 |
-
"instruction": "Please transcribe
|
28 |
"width": 9.5,
|
29 |
}
|
30 |
]
|
|
|
24 |
},
|
25 |
{
|
26 |
"name": "**Transcript**",
|
27 |
+
"instruction": "Please transcribe the speech",
|
28 |
"width": 9.5,
|
29 |
}
|
30 |
]
|
src/tunnel.py
CHANGED
@@ -6,6 +6,10 @@ import streamlit as st
|
|
6 |
from sshtunnel import SSHTunnelForwarder
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
9 |
@st.cache_resource()
|
10 |
def start_server():
|
11 |
server = SSHTunnelManager()
|
@@ -23,11 +27,11 @@ class SSHTunnelManager:
|
|
23 |
ssh_pkey=pkey,
|
24 |
local_bind_addresses=[
|
25 |
("127.0.0.1", int(port))
|
26 |
-
for port in os.getenv('LOCAL_PORTS').split(" ")
|
27 |
],
|
28 |
remote_bind_addresses=[
|
29 |
-
("127.0.0.1",
|
30 |
-
(
|
31 |
]
|
32 |
)
|
33 |
|
|
|
6 |
from sshtunnel import SSHTunnelForwarder
|
7 |
|
8 |
|
9 |
+
DEFAULT_LOCAL_PORTS = "8000 8001"
|
10 |
+
DEFAULT_REMOTE_PORTS = "8000 8001"
|
11 |
+
|
12 |
+
|
13 |
@st.cache_resource()
|
14 |
def start_server():
|
15 |
server = SSHTunnelManager()
|
|
|
27 |
ssh_pkey=pkey,
|
28 |
local_bind_addresses=[
|
29 |
("127.0.0.1", int(port))
|
30 |
+
for port in os.getenv('LOCAL_PORTS', DEFAULT_LOCAL_PORTS).split(" ")
|
31 |
],
|
32 |
remote_bind_addresses=[
|
33 |
+
("127.0.0.1", int(port))
|
34 |
+
for port in os.getenv('REMOTE_PORTS', DEFAULT_REMOTE_PORTS).split(" ")
|
35 |
]
|
36 |
)
|
37 |
|