Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,12 +41,10 @@ st.set_page_config(
|
|
| 41 |
#custom css
|
| 42 |
st.markdown("""
|
| 43 |
<style>
|
| 44 |
-
|
| 45 |
/* Font toàn app */
|
| 46 |
html, body, [class*="css"] {
|
| 47 |
font-family: 'Arial', sans-serif;
|
| 48 |
}
|
| 49 |
-
|
| 50 |
/* Nút chính */
|
| 51 |
.stButton > button[kind="primary"] {
|
| 52 |
background-color: #1a73e8;
|
|
@@ -57,11 +55,9 @@ st.markdown("""
|
|
| 57 |
font-size: 16px;
|
| 58 |
font-weight: 600;
|
| 59 |
}
|
| 60 |
-
|
| 61 |
.stButton > button[kind="primary"]:hover {
|
| 62 |
background-color: #1557b0;
|
| 63 |
}
|
| 64 |
-
|
| 65 |
/* Text area */
|
| 66 |
.stTextArea textarea {
|
| 67 |
border-radius: 10px;
|
|
@@ -69,7 +65,6 @@ st.markdown("""
|
|
| 69 |
line-height: 1.6;
|
| 70 |
font-size: 15px;
|
| 71 |
}
|
| 72 |
-
|
| 73 |
/* Metric cards */
|
| 74 |
[data-testid="metric-container"] {
|
| 75 |
background-color: #f8f9fa;
|
|
@@ -77,18 +72,15 @@ st.markdown("""
|
|
| 77 |
padding: 15px;
|
| 78 |
border-radius: 12px;
|
| 79 |
}
|
| 80 |
-
|
| 81 |
/* Responsive cho mobile */
|
| 82 |
@media (max-width: 768px) {
|
| 83 |
h1 {
|
| 84 |
font-size: 1.8rem;
|
| 85 |
}
|
| 86 |
-
|
| 87 |
.stTextArea textarea {
|
| 88 |
font-size: 14px;
|
| 89 |
}
|
| 90 |
}
|
| 91 |
-
|
| 92 |
</style>
|
| 93 |
""", unsafe_allow_html=True)
|
| 94 |
#model config
|
|
@@ -193,13 +185,14 @@ def summarize_text(
|
|
| 193 |
# Thêm dòng này để fix dính từ
|
| 194 |
summary = fix_bartpho_output(summary)
|
| 195 |
|
| 196 |
-
|
| 197 |
|
| 198 |
return {
|
| 199 |
"summary": summary,
|
| 200 |
"time": elapsed_time
|
| 201 |
}
|
| 202 |
|
|
|
|
| 203 |
# =============================================================================
|
| 204 |
# SIDEBAR
|
| 205 |
# =============================================================================
|
|
|
|
| 41 |
#custom css
|
| 42 |
st.markdown("""
|
| 43 |
<style>
|
|
|
|
| 44 |
/* Font toàn app */
|
| 45 |
html, body, [class*="css"] {
|
| 46 |
font-family: 'Arial', sans-serif;
|
| 47 |
}
|
|
|
|
| 48 |
/* Nút chính */
|
| 49 |
.stButton > button[kind="primary"] {
|
| 50 |
background-color: #1a73e8;
|
|
|
|
| 55 |
font-size: 16px;
|
| 56 |
font-weight: 600;
|
| 57 |
}
|
|
|
|
| 58 |
.stButton > button[kind="primary"]:hover {
|
| 59 |
background-color: #1557b0;
|
| 60 |
}
|
|
|
|
| 61 |
/* Text area */
|
| 62 |
.stTextArea textarea {
|
| 63 |
border-radius: 10px;
|
|
|
|
| 65 |
line-height: 1.6;
|
| 66 |
font-size: 15px;
|
| 67 |
}
|
|
|
|
| 68 |
/* Metric cards */
|
| 69 |
[data-testid="metric-container"] {
|
| 70 |
background-color: #f8f9fa;
|
|
|
|
| 72 |
padding: 15px;
|
| 73 |
border-radius: 12px;
|
| 74 |
}
|
|
|
|
| 75 |
/* Responsive cho mobile */
|
| 76 |
@media (max-width: 768px) {
|
| 77 |
h1 {
|
| 78 |
font-size: 1.8rem;
|
| 79 |
}
|
|
|
|
| 80 |
.stTextArea textarea {
|
| 81 |
font-size: 14px;
|
| 82 |
}
|
| 83 |
}
|
|
|
|
| 84 |
</style>
|
| 85 |
""", unsafe_allow_html=True)
|
| 86 |
#model config
|
|
|
|
| 185 |
# Thêm dòng này để fix dính từ
|
| 186 |
summary = fix_bartpho_output(summary)
|
| 187 |
|
| 188 |
+
elapsed = round(time.time() - start_time, 2)
|
| 189 |
|
| 190 |
return {
|
| 191 |
"summary": summary,
|
| 192 |
"time": elapsed_time
|
| 193 |
}
|
| 194 |
|
| 195 |
+
|
| 196 |
# =============================================================================
|
| 197 |
# SIDEBAR
|
| 198 |
# =============================================================================
|