Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1897,6 +1897,43 @@ def show_main_app():
|
|
| 1897 |
-webkit-text-fill-color: black !important;
|
| 1898 |
opacity: 1 !important;
|
| 1899 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1900 |
|
| 1901 |
</style>
|
| 1902 |
""", unsafe_allow_html=True)
|
|
@@ -2029,7 +2066,9 @@ Respond as DilBot with warmth, empathy, and understanding. Keep it conversationa
|
|
| 2029 |
sims = util.pytorch_cos_sim(user_embedding, quote_embeddings)[0]
|
| 2030 |
best_match = sims.argmax().item()
|
| 2031 |
selected_quote = current_quotes[best_match]
|
| 2032 |
-
st.info(f" **Quote for you:** *{selected_quote}*")
|
|
|
|
|
|
|
| 2033 |
|
| 2034 |
# DilBot's response presented in a chat bubble
|
| 2035 |
st.markdown(f"<div class='bot-message-container'><div class='bot-message'>DilBot: {response}</div></div>", unsafe_allow_html=True)
|
|
|
|
| 1897 |
-webkit-text-fill-color: black !important;
|
| 1898 |
opacity: 1 !important;
|
| 1899 |
}
|
| 1900 |
+
/*for quotes */
|
| 1901 |
+
/* Custom CSS for a reusable "info-box" component */
|
| 1902 |
+
.custom-info-box {
|
| 1903 |
+
background-color: #e6f7ff;
|
| 1904 |
+
border-left: 6px solid #64b5f6;
|
| 1905 |
+
border-radius: 10px;
|
| 1906 |
+
padding: 18px 25px;
|
| 1907 |
+
margin-top: 2rem;
|
| 1908 |
+
font-size: 1.05em;
|
| 1909 |
+
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
|
| 1910 |
+
display: flex;
|
| 1911 |
+
align-items: center;
|
| 1912 |
+
}
|
| 1913 |
+
|
| 1914 |
+
/* Style for the icon within the custom info box */
|
| 1915 |
+
.custom-info-box .info-icon {
|
| 1916 |
+
font-size: 1.5em;
|
| 1917 |
+
margin-right: 10px;
|
| 1918 |
+
color: #64b5f6;
|
| 1919 |
+
}
|
| 1920 |
+
|
| 1921 |
+
/* Styles for the text content within the custom info box */
|
| 1922 |
+
.custom-info-box .info-text {
|
| 1923 |
+
color: black !important;
|
| 1924 |
+
-webkit-text-fill-color: black !important;
|
| 1925 |
+
opacity: 1 !important;
|
| 1926 |
+
font-style: italic; /* Apply italic here directly */
|
| 1927 |
+
margin: 0; /* Remove default paragraph margin */
|
| 1928 |
+
}
|
| 1929 |
+
|
| 1930 |
+
/* If you want bold text within this custom info box to also be black
|
| 1931 |
+
.custom-info-box .info-text strong,
|
| 1932 |
+
.custom-info-box .info-text b {
|
| 1933 |
+
color: black !important;
|
| 1934 |
+
-webkit-text-fill-color: black !important;
|
| 1935 |
+
opacity: 1 !important; */
|
| 1936 |
+
}
|
| 1937 |
|
| 1938 |
</style>
|
| 1939 |
""", unsafe_allow_html=True)
|
|
|
|
| 2066 |
sims = util.pytorch_cos_sim(user_embedding, quote_embeddings)[0]
|
| 2067 |
best_match = sims.argmax().item()
|
| 2068 |
selected_quote = current_quotes[best_match]
|
| 2069 |
+
#st.info(f" **Quote for you:** *{selected_quote}*")
|
| 2070 |
+
st.markdown(f"""<div class="custom-info-box"><span class="info-icon">ℹ</span><p class="info-text">
|
| 2071 |
+
<strong>Quote for you:</strong> {selected_quote}</p> </div> """, unsafe_allow_html=True)
|
| 2072 |
|
| 2073 |
# DilBot's response presented in a chat bubble
|
| 2074 |
st.markdown(f"<div class='bot-message-container'><div class='bot-message'>DilBot: {response}</div></div>", unsafe_allow_html=True)
|