Update pages/type_text.py
Browse files- pages/type_text.py +15 -3
pages/type_text.py
CHANGED
@@ -22,6 +22,21 @@ def make_spinner(text = "In progress..."):
|
|
22 |
with st.spinner(text):
|
23 |
yield
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
#@st.cache
|
26 |
def convert_df(df:pd.DataFrame):
|
27 |
return df.to_csv(index=False).encode('utf-8')
|
@@ -150,9 +165,6 @@ def load_pipe():
|
|
150 |
return pipe
|
151 |
pipe = load_pipe()
|
152 |
|
153 |
-
for i in range(40):
|
154 |
-
st.write(f"This is scrollable content line {i}")
|
155 |
-
|
156 |
# Semantic search, Compute cosine similarity between INTdesc_embedding and SBS descriptions
|
157 |
INTdesc_embedding = model.encode(INTdesc_input)
|
158 |
SBScorpus_embeddings = model.encode(SBScorpus)
|
|
|
22 |
with st.spinner(text):
|
23 |
yield
|
24 |
|
25 |
+
# Add a dummy element at the bottom
|
26 |
+
st.markdown('<div id="bottom"></div>', unsafe_allow_html=True)
|
27 |
+
|
28 |
+
# JavaScript to scroll the dummy element into view
|
29 |
+
scroll_script = """
|
30 |
+
<script>
|
31 |
+
document.addEventListener('DOMContentLoaded', function() {
|
32 |
+
const bottomElement = window.parent.document.getElementById('bottom');
|
33 |
+
if (bottomElement) {
|
34 |
+
bottomElement.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
35 |
+
}
|
36 |
+
});
|
37 |
+
</script>
|
38 |
+
"""
|
39 |
+
|
40 |
#@st.cache
|
41 |
def convert_df(df:pd.DataFrame):
|
42 |
return df.to_csv(index=False).encode('utf-8')
|
|
|
165 |
return pipe
|
166 |
pipe = load_pipe()
|
167 |
|
|
|
|
|
|
|
168 |
# Semantic search, Compute cosine similarity between INTdesc_embedding and SBS descriptions
|
169 |
INTdesc_embedding = model.encode(INTdesc_input)
|
170 |
SBScorpus_embeddings = model.encode(SBScorpus)
|