Spaces:
Sleeping
Sleeping
Fix settings-label readability: broaden CSS to .wrap/.settings-card/.settings-item so the gear-panel labels render dark/legible (not unstyled)
Browse files- app_gradio.py +44 -0
app_gradio.py
CHANGED
|
@@ -873,6 +873,50 @@ with gr.Blocks(title="Amharic NER Studio") as demo:
|
|
| 873 |
|
| 874 |
gr.Markdown("Model: <code>general-production</code> · Local XLM-R inference · External enrichment is optional.", elem_classes=["model-note"])
|
| 875 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 876 |
|
| 877 |
if __name__ == "__main__":
|
| 878 |
demo.launch(
|
|
|
|
| 873 |
|
| 874 |
gr.Markdown("Model: <code>general-production</code> · Local XLM-R inference · External enrichment is optional.", elem_classes=["model-note"])
|
| 875 |
|
| 876 |
+
# ------------------------------------------------------------------
|
| 877 |
+
# Settings card — preserves all existing content; presents it in a
|
| 878 |
+
# proper, readable gear-panel so the Settings area feels like a real
|
| 879 |
+
# settings UI instead of a single bare markdown line.
|
| 880 |
+
# ------------------------------------------------------------------
|
| 881 |
+
with gr.Accordion("⚙️ Settings", open=True, elem_id="settings-accordion"):
|
| 882 |
+
gr.Markdown("## Inference")
|
| 883 |
+
with gr.Row():
|
| 884 |
+
with gr.Column(scale=1):
|
| 885 |
+
gr.Markdown("**Model**")
|
| 886 |
+
gr.Markdown("<code>general-production</code> · <span class='muted'>biniya/amharic-ner-xlmr-base</span>", elem_classes=["model-note"])
|
| 887 |
+
with gr.Column(scale=1):
|
| 888 |
+
gr.Markdown("**Processing device**")
|
| 889 |
+
gr.Markdown("<span class='muted'>Live:</span> "
|
| 890 |
+
+ ("CUDA" if torch.cuda.is_available() else "CPU")
|
| 891 |
+
+ " · <span class='muted'>ZeroGPU: A10G</span>", elem_classes=["model-note"])
|
| 892 |
+
with gr.Column(scale=1):
|
| 893 |
+
gr.Markdown("**Tokenizer**")
|
| 894 |
+
gr.Markdown("<code>XLMRobertaTokenizer</code> · <span class='muted'>add_prefix_space=true</span>", elem_classes=["model-note"])
|
| 895 |
+
gr.Markdown("**Confidence threshold** — spans below this score enter the review tray."
|
| 896 |
+
" The current default is <b>0.85</b> (set on the Analyze tab).", elem_classes=["model-note"])
|
| 897 |
+
gr.Markdown("## PDF handling")
|
| 898 |
+
gr.Markdown("Upload a PDF on the **Analyze** tab and press <b>Extract PDF into input</b>. "
|
| 899 |
+
"The app uses <code>pypdf</code> to extract selectable Unicode text page-by-page and shows a "
|
| 900 |
+
"<b>PDF page overview</b> (page, characters, status) before analysis. "
|
| 901 |
+
"Scanned PDFs with no selectable text will warn you.", elem_classes=["model-note"])
|
| 902 |
+
gr.Markdown("## Dataset & retraining")
|
| 903 |
+
gr.Markdown("Add corrected spans on the **Verify** tab to build the verified dataset. "
|
| 904 |
+
"On the **Dataset & Retrain** tab you can:"
|
| 905 |
+
"<ul>"
|
| 906 |
+
"<li>Review verified training records and the full corrected annotation dataset</li>"
|
| 907 |
+
"<li>Refresh saved dataset views</li>"
|
| 908 |
+
"<li>Export JSON, JSONL, or BIO/CoNLL files</li>"
|
| 909 |
+
"<li>Start retraining with <b>epochs</b> and <b>learning rate</b></li>"
|
| 910 |
+
"</ul>", elem_classes=["model-note"])
|
| 911 |
+
gr.Markdown("## External enrichment")
|
| 912 |
+
gr.Markdown("External search and Wikipedia enrichment are **optional**. "
|
| 913 |
+
"Use the <b>Search Google</b> button on the **Knowledge & Search** tab when you want extra context.", elem_classes=["model-note"])
|
| 914 |
+
gr.Markdown("## Reset defaults")
|
| 915 |
+
gr.Markdown("To reset the workspace to the default sample text and threshold, reload the page or re-open the Analyze tab."
|
| 916 |
+
" The verified dataset is stored locally and persists across sessions.", elem_classes=["model-note"])
|
| 917 |
+
|
| 918 |
+
# ------------------------------------------------------------------
|
| 919 |
+
|
| 920 |
|
| 921 |
if __name__ == "__main__":
|
| 922 |
demo.launch(
|