ShehryarAppsWork commited on
Commit
c5c49e4
·
verified ·
1 Parent(s): c7abf19

Upload 8 files

Browse files
Files changed (8) hide show
  1. .gitattributes +1 -0
  2. app.py +39 -40
  3. apphome.py +24 -0
  4. config.yaml +14 -14
  5. key.json +13 -0
  6. policyDoc-User.pdf +3 -0
  7. requirements.txt +13 -11
  8. styles.py +79 -79
.gitattributes CHANGED
@@ -35,3 +35,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  ChatGPT[[:space:]]Image[[:space:]]May[[:space:]]7,[[:space:]]2025,[[:space:]]03_45_47[[:space:]]PM.png filter=lfs diff=lfs merge=lfs -text
37
  backgroundPNG.png filter=lfs diff=lfs merge=lfs -text
 
 
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  ChatGPT[[:space:]]Image[[:space:]]May[[:space:]]7,[[:space:]]2025,[[:space:]]03_45_47[[:space:]]PM.png filter=lfs diff=lfs merge=lfs -text
37
  backgroundPNG.png filter=lfs diff=lfs merge=lfs -text
38
+ policyDoc-User.pdf filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -1,40 +1,39 @@
1
- import streamlit as st
2
- import streamlit.components.v1 as components
3
- import asyncio
4
- import streamlit_authenticator as stauth
5
-
6
- if "logged_in" not in st.session_state:
7
- st.session_state.logged_in = False
8
-
9
- if "previlage" not in st.session_state:
10
- st.session_state.previlage = 0
11
-
12
-
13
- #other Session state Variables:
14
- if "firsttime" not in st.session_state:
15
- st.session_state.firsttime = 0
16
-
17
-
18
-
19
- #Landing Page
20
- home_page = st.Page("apphome.py", title="Home", icon=":material/globe:")
21
- #user_page = st.Page("Usermain.py", title="User", icon=":material/add_circle:")
22
-
23
- #User
24
- #dashboard = st.Page("Usermainpages/Dashboard.py", title="Dashboard", icon=":material/add_circle:")
25
- AIManagement = st.Page("Usermainpages/AIManagement.py", title="AI Management", icon=":material/add_task:")
26
-
27
-
28
- if st.session_state.logged_in == True and st.session_state.previlage == 0:
29
- #pg = st.navigation([dashboard,AIManagement])
30
- pg = st.navigation([AIManagement])
31
- else:
32
- pg = st.navigation([home_page])
33
-
34
-
35
-
36
- if __name__ == "__main__":
37
- st.logo("LOGO/LOGO1.svg")
38
-
39
- pg.run()
40
-
 
1
+ import streamlit as st
2
+ import streamlit.components.v1 as components
3
+ import asyncio
4
+ import streamlit_authenticator as stauth
5
+
6
+ if "logged_in" not in st.session_state:
7
+ st.session_state.logged_in = False
8
+
9
+ if "previlage" not in st.session_state:
10
+ st.session_state.previlage = 0 #standard user previlage
11
+
12
+
13
+ #other Session state Variables:
14
+ if "firsttime" not in st.session_state:
15
+ st.session_state.firsttime = 0
16
+
17
+
18
+ #Landing Page
19
+ home_page = st.Page("apphome.py", title="Home", icon=":material/globe:")
20
+ #user_page = st.Page("Usermain.py", title="User", icon=":material/add_circle:")
21
+
22
+ #User
23
+ #dashboard = st.Page("Usermainpages/Dashboard.py", title="Dashboard", icon=":material/add_circle:")
24
+ AIManagement = st.Page("Usermainpages/AIManagement.py", title="AI Management", icon=":material/add_task:")
25
+
26
+
27
+ if st.session_state.logged_in == True and st.session_state.previlage == 0:
28
+ #pg = st.navigation([dashboard,AIManagement])
29
+ pg = st.navigation([AIManagement])
30
+ else:
31
+ pg = st.navigation([home_page])
32
+
33
+
34
+
35
+ if __name__ == "__main__":
36
+ st.logo("LOGO/LOGO1.svg")
37
+
38
+ pg.run()
39
+
 
apphome.py CHANGED
@@ -13,11 +13,35 @@ from IntroBars.Style7IntroBar import introBar7
13
  ########################################################
14
  #App goes here...S
15
 
 
16
  def apphome():
17
  ########################## Do not Alter this Code
18
  st.set_page_config(layout = "wide",initial_sidebar_state="collapsed",page_title = "AI Compliance Platform" ,page_icon = "Logo/LOGO1.svg")
19
  st.markdown(wholepage ,unsafe_allow_html=True)
20
  st.markdown(reduceTop_style ,unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  ##########################
22
 
23
  #Style 1
 
13
  ########################################################
14
  #App goes here...S
15
 
16
+
17
  def apphome():
18
  ########################## Do not Alter this Code
19
  st.set_page_config(layout = "wide",initial_sidebar_state="collapsed",page_title = "AI Compliance Platform" ,page_icon = "Logo/LOGO1.svg")
20
  st.markdown(wholepage ,unsafe_allow_html=True)
21
  st.markdown(reduceTop_style ,unsafe_allow_html=True)
22
+ st.markdown("""
23
+ <script>
24
+ const email = localStorage.getItem("user_email");
25
+ if (email) {
26
+ const url = new URL(window.location);
27
+ if (!url.searchParams.get("email")) {
28
+ url.searchParams.set("email", email);
29
+ window.location.replace(url);
30
+ }
31
+ }
32
+ </script>
33
+ """, unsafe_allow_html=True)
34
+ email_from_browser = st.query_params.get("email", [None])[0]
35
+ if email_from_browser:
36
+ #get vectdb of user and delete it
37
+ #remove email from local storage
38
+ st.markdown("""
39
+ <script>
40
+ localStorage.removeItem("user_email");
41
+ </script>
42
+ """, unsafe_allow_html=True)
43
+ pass
44
+
45
  ##########################
46
 
47
  #Style 1
config.yaml CHANGED
@@ -1,15 +1,15 @@
1
- credentials:
2
- usernames:
3
- vijay:
4
- email: vj@grct.net
5
- failed_login_attempts: 0 # Will be managed automatically
6
- logged_in: False # Will be managed automatically
7
- name: Vijay Kumar
8
- password: SammyJoe123 # Will be hashed automatically
9
- cookie:
10
- expiry_days: 2
11
- key: "govTAIPLT" # Must be string
12
- name: AIGOVGRCT
13
- pre-authorized:
14
- emails:
15
  - melsby@gmail.com
 
1
+ credentials:
2
+ usernames:
3
+ vijay:
4
+ email: vj@grct.net
5
+ failed_login_attempts: 0 # Will be managed automatically
6
+ logged_in: False # Will be managed automatically
7
+ name: Vijay Kumar
8
+ password: SammyJoe123 # Will be hashed automatically
9
+ cookie:
10
+ expiry_days: 2
11
+ key: "govTAIPLT" # Must be string
12
+ name: AIGOVGRCT
13
+ pre-authorized:
14
+ emails:
15
  - melsby@gmail.com
key.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "service_account",
3
+ "project_id": "ai-gov-67c19",
4
+ "private_key_id": "aee7f0d7a3a6839fb9b12cce2c3326ae6fc0770f",
5
+ "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC/BHGAV0qSe5XF\nksc1G+Pj8oKx7/zWSEkCb/QPSZTaYbWRy4yykx36MEnNPlvkahm6wlozL59WV3kw\nsYrZY7oGVeMHPZU9jTmnleAY6ciNNq3KhlT7lAfKda7/WU8M8vGP0/0/2uEaWFqD\nXXplDorhqyQQYeVTRsilGOmTXzA040t5FdPgqTz3EE69iajzAWFFtv4+RdvYxEjd\n8moIpVHl5p6D2cF/BeDvWF3DoBj2pbH1Hv0aaH+duoDCA7+6yYIwLenBV3ohl/Bj\nB10mPP6g4vXPUUgWtHJNlJ+eQRt/ygX70JKkE9JYQBp6Bt3Z3yFRn9sC4/xwOGNV\nNgPgW1WnAgMBAAECggEAGuzvat3jHx7Yj88O0Yeq6fjHP3nKtBHgaL2LM5R1rQrU\n40ZEAPAH67pezNWbcmkaU18OA+UUmsEdziVYoygRks8Mf3rIzLJZjCvuONTLdkxc\n1w10cTn+lyVbk5btM7ATKOkC67tYu7P0nkvQ8unH3eOX489I2iJCKjOGyUVDsFCS\n//ku9ATATo1rz1/iWgkfGTITCHmTwOetSt7+aj1YrhJgvByF4DwuJHwc1AVYqaFe\nyhv3rrW1hu0Kq0adX62iX6lEKBCJhQejmSys7edKs/UBZMSh/XDSuFlUsENieq14\n5LswMmxAK26vG1dHWLsjAeO/naJFpA1vpyclrZWpIQKBgQD6odDmu7ZrsCZRdh1F\nY4eiRz9b1DFzURgnh6s7XieJWZxCTmYSFyWkox/SgjfLiFdb5XHWPpr0Dv/k/VJi\nswD1afiRHXF4HuSHvp2v6OQZHX0MF5nKFDDlg8xrQiesU8o2p+IeTSsJGcI7SrZv\nFp9tn1Q+Mr5nY6Wjw0KAdg7haQKBgQDDG8Rt+FdKc5e7MUM3jn4X1CWaB73xFFo1\njSOezvdpdTSARpkm0mXZvJy2e2AUtLFPevRujrndAxodLD5JZwctPnygJ57M7VSs\nSp6aYTMxIaO6Vkgua4S1mkhs2OkVqV41In3dNgfq5RIA03eZDOSX5qY+RzL1lmGK\nZyRt1daMjwKBgQDtW6YtfgSLA+2mJEggWNww8WytmM2kOl63wSKHPOoQh88WdIzy\nAP3jZ6FRiYUxulORckBW+D9jd3kc8lO9qWz0/oErXUkCy67+Z6WK3PJ4Xpb4hrlc\nybZtBl7oDWTpLQlKrb/Vlpt1KPHrmRwhJLmj5cqwhPoRjCtoZhlq82OwUQKBgQCO\nY/RuYYCrOEMy/VfV8us5Tr2GdUH88GKJlJC7dMaBs2T2fQ+GkqR8TLd+Qfo0Ak8o\n903uZcFld78WLVTj0wocze68H044trhF6Uto1ak7oRZRhmi1YAiBVLCop4EsKugz\nFRIQYD9VAYqrCanOC+fEqDMJXoLlUrOrA21Fr3seJwKBgG7nUKN9BowWhNI3FGUx\ngh7KCuE/zqSCajWzevDlOP/E84DEHtk0oYwJ3IcpHWyiZI/SxZw7ZUi9wleAEDtp\nUWIogyqfHV5s1wm2l9pS1bjWwZQnBykA0uzSfw9idytyOk9wVVYGeiEb+mCRCeQu\nfnW1VxXJYs9FDwkYwaEPqEj8\n-----END PRIVATE KEY-----\n",
6
+ "client_email": "firebase-adminsdk-fbsvc@ai-gov-67c19.iam.gserviceaccount.com",
7
+ "client_id": "113685746152591388757",
8
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
9
+ "token_uri": "https://oauth2.googleapis.com/token",
10
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40ai-gov-67c19.iam.gserviceaccount.com",
12
+ "universe_domain": "googleapis.com"
13
+ }
policyDoc-User.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38e90ad985316cddf8ccd10e032111d989438c70758d3f739b16c8fa8d684569
3
+ size 310704
requirements.txt CHANGED
@@ -1,11 +1,13 @@
1
- streamlit==1.37.1
2
- streamlit-autorefresh==1.0.1
3
- streamlit-navigation-bar==3.3.0
4
- streamlit-option-menu==0.3.13
5
- streamlit-authenticator
6
- streamlit-quill
7
- pymupdf4llm
8
- semantic-text-splitter
9
- pinecone
10
- groq
11
- https://core-previews.s3-us-west-2.amazonaws.com/pr-9333/streamlit-1.37.1-py2.py3-none-any.whl
 
 
 
1
+ streamlit==1.37.1
2
+ streamlit-autorefresh==1.0.1
3
+ streamlit-navigation-bar==3.3.0
4
+ streamlit-option-menu==0.3.13
5
+ streamlit-authenticator
6
+ streamlit-quill
7
+ pymupdf4llm
8
+ semantic-text-splitter
9
+ pinecone
10
+ groq
11
+ https://core-previews.s3-us-west-2.amazonaws.com/pr-9333/streamlit-1.37.1-py2.py3-none-any.whl
12
+ firebase-admin
13
+ bcrypt
styles.py CHANGED
@@ -1,80 +1,80 @@
1
- #style for the main container to contain image
2
- wholepage = """
3
- <style>
4
- *, ::before, ::after {
5
- box-sizing: revert-layer;
6
- }
7
- </style>
8
- """
9
-
10
- borderpage = """
11
- <style>
12
- *, ::before, ::after {
13
- box-sizing: border-box;
14
- }
15
- </style>
16
- """
17
-
18
- mainCont_style = """
19
- <style>
20
- .st-emotion-cache-1xuzhe1 {
21
- height: 700px;
22
- overflow: auto;
23
- display: flex;
24
- justify-content: center;
25
- align-items: center;
26
- background: url('https://wallpaperaccess.com/full/3228833.jpg'), #6DB3F2;
27
- background-size: cover; /* Scale the background image to cover the entire container */
28
- background-repeat: no-repeat; /* Prevent the background image from repeating */
29
- background-position: center; /* Center the background image within the container */
30
- }
31
- .stream-text {
32
- text-align: center;
33
- }
34
- </style>
35
- """
36
-
37
- reduceTop_style = """
38
- <style>
39
- .st-emotion-cache-1jicfl2, .st-emotion-cache-1a46zap, [data-testid="stAppViewBlockContainer"] {
40
- width: 100%;
41
- padding: 0rem 0rem 10rem;
42
- min-width: auto;
43
- max-width: initial;
44
- }
45
- </style>
46
- """
47
-
48
- navstyle3_style = """
49
- <style>
50
- /* Targeting the iframe by its src attribute */
51
- iframe[src*="streamlit_option_menu.option_menu"] {
52
- position: fixed;
53
- top: 2pt;
54
- /*bottom:0pt;*/
55
- z-index: 999990;
56
- }
57
-
58
- .st-emotion-cache-12fmjuu, .st-emotion-cache-h4xjwg {
59
- position: unset;
60
- }
61
-
62
- .st-emotion-cache-15ecox0 {
63
- top: 0.8rem;
64
- right: 0.7rem;
65
- }
66
-
67
- .st-emotion-cache-czk5ss {
68
- z-index: 999999;
69
- }
70
- </style>
71
- """
72
-
73
- pagemargin = """
74
- <style>
75
- .st-emotion-cache-ocqkz7.e1f1d6gn5 {
76
- margin-left: 10px;
77
- margin-right: 10px;
78
- }
79
- </style>
80
  """
 
1
+ #style for the main container to contain image
2
+ wholepage = """
3
+ <style>
4
+ *, ::before, ::after {
5
+ box-sizing: revert-layer;
6
+ }
7
+ </style>
8
+ """
9
+
10
+ borderpage = """
11
+ <style>
12
+ *, ::before, ::after {
13
+ box-sizing: border-box;
14
+ }
15
+ </style>
16
+ """
17
+
18
+ mainCont_style = """
19
+ <style>
20
+ .st-emotion-cache-1xuzhe1 {
21
+ height: 700px;
22
+ overflow: auto;
23
+ display: flex;
24
+ justify-content: center;
25
+ align-items: center;
26
+ background: url('https://huggingface.co/spaces/Global-Risk/Images/resolve/main/background3.png'), #6DB3F2;
27
+ background-size: cover; /* Scale the background image to cover the entire container */
28
+ background-repeat: no-repeat; /* Prevent the background image from repeating */
29
+ background-position: center; /* Center the background image within the container */
30
+ }
31
+ .stream-text {
32
+ text-align: center;
33
+ }
34
+ </style>
35
+ """
36
+
37
+ reduceTop_style = """
38
+ <style>
39
+ .st-emotion-cache-1jicfl2, .st-emotion-cache-1a46zap, [data-testid="stAppViewBlockContainer"] {
40
+ width: 100%;
41
+ padding: 0rem 0rem 10rem;
42
+ min-width: auto;
43
+ max-width: initial;
44
+ }
45
+ </style>
46
+ """
47
+
48
+ navstyle3_style = """
49
+ <style>
50
+ /* Targeting the iframe by its src attribute */
51
+ iframe[src*="streamlit_option_menu.option_menu"] {
52
+ position: fixed;
53
+ top: 2pt;
54
+ /*bottom:0pt;*/
55
+ z-index: 999990;
56
+ }
57
+
58
+ .st-emotion-cache-12fmjuu, .st-emotion-cache-h4xjwg {
59
+ position: unset;
60
+ }
61
+
62
+ .st-emotion-cache-15ecox0 {
63
+ top: 0.8rem;
64
+ right: 0.7rem;
65
+ }
66
+
67
+ .st-emotion-cache-czk5ss {
68
+ z-index: 999999;
69
+ }
70
+ </style>
71
+ """
72
+
73
+ pagemargin = """
74
+ <style>
75
+ .st-emotion-cache-ocqkz7.e1f1d6gn5 {
76
+ margin-left: 10px;
77
+ margin-right: 10px;
78
+ }
79
+ </style>
80
  """