georad commited on
Commit
af9afd0
·
verified ·
1 Parent(s): 3b4fbeb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -3
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import streamlit as st
2
  import pandas as pd
3
  from io import StringIO
@@ -8,19 +9,49 @@ from sentence_transformers import SentenceTransformer, util
8
  #import lmdeploy
9
  #import turbomind as tm
10
 
 
 
 
 
 
 
 
11
  import os
12
  os.getenv("HF_TOKEN")
13
 
 
 
 
 
 
 
14
  PAGES = {
15
- "Home": Home,
16
  "Demo": Demo,
17
- "About": About
18
  }
19
 
20
  st.sidebar.title("SBSmapper")
21
  selection = st.sidebar.radio("Pages", list(PAGES.keys()))
22
 
23
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
 
26
  def on_click():
 
1
+ import awesome_streamlit as ast
2
  import streamlit as st
3
  import pandas as pd
4
  from io import StringIO
 
9
  #import lmdeploy
10
  #import turbomind as tm
11
 
12
+ from backend.utils import get_current_ram_usage, ga
13
+ #import backend.aragpt
14
+ import backend.home
15
+ import backend.processor
16
+ #import backend.sa
17
+ #import backend.qa
18
+
19
  import os
20
  os.getenv("HF_TOKEN")
21
 
22
+ st.set_page_config(
23
+ page_title="TEST", page_icon="📖", initial_sidebar_state="expanded", layout="wide"
24
+ )
25
+
26
+ ga(st.__file__)
27
+
28
  PAGES = {
29
+ "Home": backend.home,
30
  "Demo": Demo,
31
+ "About": backend.home
32
  }
33
 
34
  st.sidebar.title("SBSmapper")
35
  selection = st.sidebar.radio("Pages", list(PAGES.keys()))
36
 
37
+ page = PAGES[selection]
38
+ # with st.spinner(f"Loading {selection} ..."):
39
+ #ast.shared.components.write_page(page)
40
+
41
+ st.sidebar.header("Info")
42
+ st.sidebar.write("Project by JA RAD")
43
+ #st.sidebar.write(
44
+ # "Pre-trained models are available on [HF Hub](https://huggingface.co/)"
45
+ #)
46
+ #st.sidebar.write(
47
+ # "Models source code available on [GitHub](https://github.com/)"
48
+ #)
49
+ #st.sidebar.write(
50
+ # "App source code available on [GitHub](https://github.com/)"
51
+ #)
52
+ if st.sidebar.checkbox("Show RAM usage"):
53
+ ram = get_current_ram_usage()
54
+ st.sidebar.write("Ram usage: {:.2f}/{:.2f} GB".format(ram[0], ram[1]))
55
 
56
 
57
  def on_click():