more cleanup
Browse files
.Rhistory
ADDED
File without changes
|
app.py
CHANGED
@@ -1,18 +1,17 @@
|
|
1 |
# app.py
|
2 |
|
3 |
import streamlit as st
|
|
|
|
|
|
|
4 |
import os
|
5 |
import re
|
6 |
import numpy as np
|
7 |
import pandas as pd
|
8 |
-
from dotenv import load_dotenv
|
9 |
from langchain.docstore.document import Document
|
10 |
from openai import OpenAI
|
11 |
import utils # Import the utils module
|
12 |
|
13 |
-
# os.environ.pop("OPENAI_API_KEY", None)
|
14 |
-
# load_dotenv()
|
15 |
-
|
16 |
openai_api_key = os.environ["OPENAI_API_KEY"]
|
17 |
|
18 |
# Initialize OpenAI client
|
|
|
1 |
# app.py
|
2 |
|
3 |
import streamlit as st
|
4 |
+
st.set_page_config(page_title = 'Climate Policy Vulnerabilities RAG App',
|
5 |
+
initial_sidebar_state='expanded', layout="wide")
|
6 |
+
|
7 |
import os
|
8 |
import re
|
9 |
import numpy as np
|
10 |
import pandas as pd
|
|
|
11 |
from langchain.docstore.document import Document
|
12 |
from openai import OpenAI
|
13 |
import utils # Import the utils module
|
14 |
|
|
|
|
|
|
|
15 |
openai_api_key = os.environ["OPENAI_API_KEY"]
|
16 |
|
17 |
# Initialize OpenAI client
|
style.css
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
.row-widget.stTextInput > div:first-of-type {
|
4 |
+
background: #fff;
|
5 |
+
display: flex;
|
6 |
+
border: 1px solid #dfe1e5;
|
7 |
+
box-shadow: none;
|
8 |
+
border-radius: 24px;
|
9 |
+
height: 50px;
|
10 |
+
width: auto;
|
11 |
+
margin: 10px auto 30px;
|
12 |
+
}
|
13 |
+
|
14 |
+
.row-widget.stTextInput > div:first-of-type:hover,
|
15 |
+
.row-widget.stTextInput > div:first-of-type:focus {
|
16 |
+
box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0.2);
|
17 |
+
}
|
18 |
+
|
19 |
+
.row-widget.stTextInput .st-bq {
|
20 |
+
background-color: #fff;
|
21 |
+
}
|
22 |
+
|
23 |
+
.row-widget.stTextInput > label {
|
24 |
+
color: #b3b3b3;
|
25 |
+
}
|
26 |
+
|
27 |
+
.row-widget.stButton > button {
|
28 |
+
border-radius: 24px;
|
29 |
+
background-color: #B6C9B1;
|
30 |
+
color: #fff;
|
31 |
+
border: none;
|
32 |
+
padding: 6px 20px;
|
33 |
+
float: right;
|
34 |
+
background-image: none;
|
35 |
+
}
|
36 |
+
|
37 |
+
.row-widget.stButton > button:hover {
|
38 |
+
box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0.2);
|
39 |
+
}
|
40 |
+
|
41 |
+
.row-widget.stButton > button:focus {
|
42 |
+
border: none;
|
43 |
+
color: #fff;
|
44 |
+
}
|
45 |
+
|
46 |
+
.footer-custom {
|
47 |
+
position: fixed;
|
48 |
+
bottom: 0;
|
49 |
+
width: 100%;
|
50 |
+
color: var(--text-color);
|
51 |
+
max-width: 698px;
|
52 |
+
font-size: 14px;
|
53 |
+
height: 50px;
|
54 |
+
padding: 10px 0;
|
55 |
+
z-index: 50;
|
56 |
+
}
|
57 |
+
|
58 |
+
.main {
|
59 |
+
padding: 20px;
|
60 |
+
}
|
61 |
+
|
62 |
+
footer {
|
63 |
+
display: none !important;
|
64 |
+
}
|
65 |
+
|
66 |
+
.footer-custom a {
|
67 |
+
color: var(--text-color);
|
68 |
+
}
|
69 |
+
|
70 |
+
#wikipedia-assistant {
|
71 |
+
font-size: 36px;
|
72 |
+
}
|
73 |
+
|
74 |
+
.generated-answer p {
|
75 |
+
font-size: 16px;
|
76 |
+
font-weight: bold;
|
77 |
+
}
|
78 |
+
|
79 |
+
.react-json-view {
|
80 |
+
margin: 40px 0 80px;
|
81 |
+
}
|
82 |
+
|
83 |
+
.tooltip {
|
84 |
+
text-align: center;
|
85 |
+
line-height: 20px;
|
86 |
+
display: table-caption;
|
87 |
+
font-size: 10px;
|
88 |
+
border-radius: 50%;
|
89 |
+
height: 20px;
|
90 |
+
width: 20px;
|
91 |
+
position: relative;
|
92 |
+
cursor: pointer;
|
93 |
+
color:#000;
|
94 |
+
}
|
95 |
+
|
96 |
+
.tooltip .tooltiptext {
|
97 |
+
visibility: hidden;
|
98 |
+
width: 280px;
|
99 |
+
text-align: center;
|
100 |
+
border-radius: 6px;
|
101 |
+
padding: 10px;
|
102 |
+
position: absolute;
|
103 |
+
z-index: 1;
|
104 |
+
top: 25px;
|
105 |
+
left: 50%;
|
106 |
+
margin-left: -140px;
|
107 |
+
font-size: 14px;
|
108 |
+
background-color: #fff;
|
109 |
+
border: 1px solid #ccc;
|
110 |
+
box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.16);
|
111 |
+
color: #000;
|
112 |
+
}
|
113 |
+
|
114 |
+
.tooltip:hover .tooltiptext {
|
115 |
+
visibility: visible;
|
116 |
+
}
|
117 |
+
|
118 |
+
.sentence-wrapper {
|
119 |
+
border-left: 4px solid #ffc423;
|
120 |
+
padding-left: 20px;
|
121 |
+
margin-bottom: 40px;
|
122 |
+
}
|
123 |
+
|
124 |
+
#context {
|
125 |
+
padding: 2rem 0 1rem;
|
126 |
+
}
|
127 |
+
|
128 |
+
hr {
|
129 |
+
margin: 2em 0 1em;
|
130 |
+
}
|
131 |
+
|
132 |
+
|
133 |
+
.technical-details-info {
|
134 |
+
margin-bottom: 100px;
|
135 |
+
}
|
136 |
+
|
137 |
+
.loader-wrapper {
|
138 |
+
display: flex;
|
139 |
+
align-items: center;
|
140 |
+
background-color: rgba(250, 202, 43, 0.2);
|
141 |
+
padding: 15px 20px;
|
142 |
+
border-radius: 6px;
|
143 |
+
}
|
144 |
+
|
145 |
+
.loader-wrapper p {
|
146 |
+
margin-bottom: 0;
|
147 |
+
margin-left: 20px;
|
148 |
+
}
|
149 |
+
|
150 |
+
.loader {
|
151 |
+
width: 30px;
|
152 |
+
height: 30px;
|
153 |
+
border: dotted 5px #868686;
|
154 |
+
border-radius: 100%;
|
155 |
+
animation: spin 1s linear infinite;
|
156 |
+
}
|
157 |
+
|
158 |
+
.loader-note {
|
159 |
+
font-size: 14px;
|
160 |
+
color: #b3b3b3;
|
161 |
+
margin-left: 5px;
|
162 |
+
}
|
163 |
+
|
164 |
+
@keyframes spin {
|
165 |
+
0% {
|
166 |
+
transform: rotate(0deg) scale(0.8);
|
167 |
+
border-top-color: transparent;
|
168 |
+
border-right-color: transparent;
|
169 |
+
}
|
170 |
+
50% { transform: rotate(180deg) scale(1.2);
|
171 |
+
border-color: #949494;
|
172 |
+
border-top-color: transparent;
|
173 |
+
border-right-color: transparent;
|
174 |
+
}
|
175 |
+
100% { transform: rotate(360deg) scale(0.8);
|
176 |
+
border-color: #bbbbbb;
|
177 |
+
border-top-color: transparent;
|
178 |
+
border-right-color: transparent;
|
179 |
+
}
|
180 |
+
}
|