Spaces:
Running
Running
R3.2.8.6-R1.3C-KK1-R2 Clean Deploy English Pane Purity and Premature Stream Retry
#34
by GuXiaopeng - opened
- .streamlit/desktop.ini +0 -2
- app.py +4 -1
- core/desktop.ini +0 -2
- core/pipeline_agent.py +1 -0
- desktop.ini +0 -2
- smartpaper_restore_bridge/desktop.ini +0 -2
- smartpaper_restore_bridge/frontend/desktop.ini +0 -2
- smartpaper_restore_bridge/frontend/index.html +14 -4
- static/desktop.ini +0 -2
- static/previews/desktop.ini +0 -2
- utils/desktop.ini +0 -2
.streamlit/desktop.ini
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
[.ShellClassInfo]
|
| 2 |
-
IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -833,7 +833,9 @@ def _render_checkpoint_preview(task: dict, lang_code: str) -> None:
|
|
| 833 |
checkpoint = _load_confirmed_checkpoint(task)
|
| 834 |
english = str((checkpoint or {}).get("full_draft_en") or "").strip()
|
| 835 |
target = str((checkpoint or {}).get("full_draft_translated") or "").strip()
|
| 836 |
-
english_initial = english
|
|
|
|
|
|
|
| 837 |
target_initial = target if target else tr(lang_code, "translation_waiting")
|
| 838 |
english_placeholder = "0" if english else "1"
|
| 839 |
target_placeholder = "0" if target else "1"
|
|
@@ -842,6 +844,7 @@ def _render_checkpoint_preview(task: dict, lang_code: str) -> None:
|
|
| 842 |
st.markdown(tr(lang_code, "english_draft"))
|
| 843 |
st.markdown(
|
| 844 |
f"""
|
|
|
|
| 845 |
<div id='sp-live-manuscript-shell' style='border:1px solid #e5e7eb;border-radius:8px;padding:14px 16px;min-height:220px;max-height:68vh;overflow:auto;background:#ffffff;'>
|
| 846 |
<div id='sp-live-manuscript-preview' data-sp-placeholder='{english_placeholder}' style='white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-family:inherit;line-height:1.72;color:#111827;'>{html.escape(english_initial)}</div>
|
| 847 |
<span id='sp-live-manuscript-cursor' aria-hidden='true' style='display:inline-block;width:7px;height:1.05em;background:#111827;margin-left:2px;vertical-align:-0.12em;animation:spBlink 1s steps(1,end) infinite;'></span>
|
|
|
|
| 833 |
checkpoint = _load_confirmed_checkpoint(task)
|
| 834 |
english = str((checkpoint or {}).get("full_draft_en") or "").strip()
|
| 835 |
target = str((checkpoint or {}).get("full_draft_translated") or "").strip()
|
| 836 |
+
english_initial = english
|
| 837 |
+
english_status_initial = "" if english else tr(lang_code, "draft_preparing")
|
| 838 |
+
english_status_display = "none" if english else "block"
|
| 839 |
target_initial = target if target else tr(lang_code, "translation_waiting")
|
| 840 |
english_placeholder = "0" if english else "1"
|
| 841 |
target_placeholder = "0" if target else "1"
|
|
|
|
| 844 |
st.markdown(tr(lang_code, "english_draft"))
|
| 845 |
st.markdown(
|
| 846 |
f"""
|
| 847 |
+
<div id='sp-live-manuscript-status' style='white-space:pre-wrap;font-size:0.88em;opacity:0.72;margin:0 0 8px 0;display:{english_status_display};'>{html.escape(english_status_initial)}</div>
|
| 848 |
<div id='sp-live-manuscript-shell' style='border:1px solid #e5e7eb;border-radius:8px;padding:14px 16px;min-height:220px;max-height:68vh;overflow:auto;background:#ffffff;'>
|
| 849 |
<div id='sp-live-manuscript-preview' data-sp-placeholder='{english_placeholder}' style='white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-family:inherit;line-height:1.72;color:#111827;'>{html.escape(english_initial)}</div>
|
| 850 |
<span id='sp-live-manuscript-cursor' aria-hidden='true' style='display:inline-block;width:7px;height:1.05em;background:#111827;margin-left:2px;vertical-align:-0.12em;animation:spBlink 1s steps(1,end) infinite;'></span>
|
core/desktop.ini
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
[.ShellClassInfo]
|
| 2 |
-
IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
|
|
|
|
|
|
|
|
|
core/pipeline_agent.py
CHANGED
|
@@ -1071,6 +1071,7 @@ class SSciPipelineAgent:
|
|
| 1071 |
except (
|
| 1072 |
requests.exceptions.Timeout,
|
| 1073 |
requests.exceptions.ConnectionError,
|
|
|
|
| 1074 |
requests.exceptions.HTTPError,
|
| 1075 |
DeepSeekAPIError,
|
| 1076 |
) as exc:
|
|
|
|
| 1071 |
except (
|
| 1072 |
requests.exceptions.Timeout,
|
| 1073 |
requests.exceptions.ConnectionError,
|
| 1074 |
+
requests.exceptions.ChunkedEncodingError,
|
| 1075 |
requests.exceptions.HTTPError,
|
| 1076 |
DeepSeekAPIError,
|
| 1077 |
) as exc:
|
desktop.ini
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
[.ShellClassInfo]
|
| 2 |
-
IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
|
|
|
|
|
|
|
|
|
smartpaper_restore_bridge/desktop.ini
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
[.ShellClassInfo]
|
| 2 |
-
IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
|
|
|
|
|
|
|
|
|
smartpaper_restore_bridge/frontend/desktop.ini
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
[.ShellClassInfo]
|
| 2 |
-
IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
|
|
|
|
|
|
|
|
|
smartpaper_restore_bridge/frontend/index.html
CHANGED
|
@@ -316,9 +316,14 @@
|
|
| 316 |
}
|
| 317 |
|
| 318 |
function updateDraftPreparation(parentDocument, node, labels, task=null) {
|
| 319 |
-
const
|
| 320 |
const channel = renderChannels.english;
|
| 321 |
-
if (!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
const map = labels && typeof labels === "object" ? labels : {};
|
| 323 |
const progress = Math.max(0, Math.min(100, asCount(task && task.progress_pct)));
|
| 324 |
const s2 = asCount(task && task.s2_calls);
|
|
@@ -331,8 +336,8 @@
|
|
| 331 |
if (map.oa) lines.push(formatTemplate(map.oa, {count:oa}));
|
| 332 |
const value = lines.filter(Boolean).join("\n");
|
| 333 |
if (!value) return;
|
| 334 |
-
|
| 335 |
-
|
| 336 |
}
|
| 337 |
|
| 338 |
function ensureTargetStatusNode(parentDocument) {
|
|
@@ -540,6 +545,11 @@
|
|
| 540 |
const targetText = String(payload && payload.target_text || "");
|
| 541 |
if (englishText && englishText !== lastPreviewText) {
|
| 542 |
updateOnePreview(parentDocument, parentWindow, "sp-live-manuscript-preview", "sp-live-manuscript-shell", englishText, renderChannels.english);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 543 |
lastPreviewText = englishText;
|
| 544 |
}
|
| 545 |
if (targetText && targetText !== lastTargetPreviewText) {
|
|
|
|
| 316 |
}
|
| 317 |
|
| 318 |
function updateDraftPreparation(parentDocument, node, labels, task=null) {
|
| 319 |
+
const status = parentDocument.getElementById("sp-live-manuscript-status");
|
| 320 |
const channel = renderChannels.english;
|
| 321 |
+
if (!status) return;
|
| 322 |
+
if (channel.authoritative) {
|
| 323 |
+
status.textContent = "";
|
| 324 |
+
status.style.display = "none";
|
| 325 |
+
return;
|
| 326 |
+
}
|
| 327 |
const map = labels && typeof labels === "object" ? labels : {};
|
| 328 |
const progress = Math.max(0, Math.min(100, asCount(task && task.progress_pct)));
|
| 329 |
const s2 = asCount(task && task.s2_calls);
|
|
|
|
| 336 |
if (map.oa) lines.push(formatTemplate(map.oa, {count:oa}));
|
| 337 |
const value = lines.filter(Boolean).join("\n");
|
| 338 |
if (!value) return;
|
| 339 |
+
status.textContent = value;
|
| 340 |
+
status.style.display = "block";
|
| 341 |
}
|
| 342 |
|
| 343 |
function ensureTargetStatusNode(parentDocument) {
|
|
|
|
| 545 |
const targetText = String(payload && payload.target_text || "");
|
| 546 |
if (englishText && englishText !== lastPreviewText) {
|
| 547 |
updateOnePreview(parentDocument, parentWindow, "sp-live-manuscript-preview", "sp-live-manuscript-shell", englishText, renderChannels.english);
|
| 548 |
+
const englishStatus = parentDocument.getElementById("sp-live-manuscript-status");
|
| 549 |
+
if (englishStatus) {
|
| 550 |
+
englishStatus.textContent = "";
|
| 551 |
+
englishStatus.style.display = "none";
|
| 552 |
+
}
|
| 553 |
lastPreviewText = englishText;
|
| 554 |
}
|
| 555 |
if (targetText && targetText !== lastTargetPreviewText) {
|
static/desktop.ini
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
[.ShellClassInfo]
|
| 2 |
-
IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
|
|
|
|
|
|
|
|
|
static/previews/desktop.ini
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
[.ShellClassInfo]
|
| 2 |
-
IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
|
|
|
|
|
|
|
|
|
utils/desktop.ini
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
[.ShellClassInfo]
|
| 2 |
-
IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
|
|
|
|
|
|
|
|
|