YingxuHe commited on
Commit
0d3a8ac
·
verified ·
1 Parent(s): 1e43552

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -36
app.py CHANGED
@@ -2,49 +2,48 @@ import os
2
 
3
  import streamlit as st
4
  import streamlit.components.v1 as components
 
5
 
6
- from pages.nav import Navbar
7
- from pages.utils import start_server
8
-
9
 
10
  certificate = os.getenv('PRIVATE_KEY')
11
  dns_name = os.getenv('SERVER_DNS_NAME')
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- def main():
15
-
16
- ## Set Streamlit configuration
17
- st.set_page_config(page_title='Merlion-AI-Audio', page_icon = "🔥", layout='wide')
18
-
19
- Navbar()
20
-
21
- ## Set up home page Title
22
- col1, col2 = st.columns([1, 4])
23
- custom_html = """
24
- <div class="banner">
25
- <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRhB2e_AhOe11wKxnnwOmOVg9E7J1MBgiTeYzzFAESwcCP5IbBAc2X8BwGChMfJzwqtVg&usqp=CAU" alt="Banner Image">
26
- </div>
27
- <style>
28
- .banner {
29
- width: 100%;
30
- height: 200px;
31
- overflow: visible;
32
- }
33
- .banner img {
34
- width: 100%;
35
- object-fit: cover;
36
- }
37
- </style>
38
- """
39
- with col1:
40
- components.html(custom_html)
41
- with col2:
42
- st.write("# Welcome to Merlion AI - AudioLLMs 🤖")
43
-
44
- ## Set up home page other information
45
- st.markdown('')
46
 
47
 
48
  if __name__ == '__main__':
49
- start_server(certificate, dns_name)
50
  main()
 
2
 
3
  import streamlit as st
4
  import streamlit.components.v1 as components
5
+ from st_on_hover_tabs import on_hover_tabs
6
 
7
+ from pages import *
8
+ from utils import start_server
 
9
 
10
  certificate = os.getenv('PRIVATE_KEY')
11
  dns_name = os.getenv('SERVER_DNS_NAME')
12
 
13
+ start_server(certificate, dns_name)
14
+
15
+ ## Set Streamlit configuration
16
+ st.set_page_config(page_title='MERaLiON-AudioLLM', page_icon = "🔥", layout='wide')
17
+
18
+ st.markdown('<style>' + open('./style/sidebar_style.css').read() + '</style>', unsafe_allow_html=True)
19
+
20
+ with st.sidebar:
21
+ tabs = on_hover_tabs(tabName=['HOME',
22
+ 'MERaLiON-AudioLLM',
23
+ ],
24
+ iconName=['dashboard', 'filter_1'],
25
+ styles = {
26
+ 'navtab': {
27
+ 'font-size': '12px',
28
+ 'transition': '0.3s',
29
+ 'text-transform': 'none',
30
+ },
31
+ 'iconStyle':{
32
+ 'font-size': '18px',
33
+
34
+ },
35
+ },
36
+ default_choice=0
37
+ )
38
+
39
+
40
+ if tabs =='HOME':
41
+ dashboard()
42
 
43
+ elif tabs == 'MERaLiON-AudioLLM':
44
+ asr()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
 
47
  if __name__ == '__main__':
48
+
49
  main()