Spaces:
Running
Running
GitHub Action
commited on
Commit
·
6d00bb0
1
Parent(s):
f5ced5e
Sync ling-space changes from GitHub commit 003e9ca
Browse files- app.py +6 -14
- i18n/tab_welcome.py +2 -2
- tab_smart_writer.py +1 -1
- tab_welcome.py +32 -36
app.py
CHANGED
|
@@ -38,21 +38,13 @@ footer {
|
|
| 38 |
animation-play-state: paused !important;
|
| 39 |
}
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
display: flex;
|
| 45 |
-
flex-direction: column;
|
| 46 |
-
justify-content: center; /* Center vertically */
|
| 47 |
-
align-items: center; /* Center horizontally */
|
| 48 |
-
text-align: center; /* Center text within the column */
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
.welcome-content-inner {
|
| 52 |
-
max-width: 800px; /* Or whatever appropriate width */
|
| 53 |
-
width: 100%;
|
| 54 |
padding: 20px;
|
| 55 |
-
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
.language-buttons {
|
|
|
|
| 38 |
animation-play-state: paused !important;
|
| 39 |
}
|
| 40 |
|
| 41 |
+
.welcome-content {
|
| 42 |
+
min-width: 240px;
|
| 43 |
+
max-width: 800px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
padding: 20px;
|
| 45 |
+
margin-left: auto;
|
| 46 |
+
margin-right: auto;
|
| 47 |
+
align-items: center;
|
| 48 |
}
|
| 49 |
|
| 50 |
.language-buttons {
|
i18n/tab_welcome.py
CHANGED
|
@@ -50,7 +50,7 @@ ui_translations = {
|
|
| 50 |
"zh": "English"
|
| 51 |
},
|
| 52 |
"lang_zh": {
|
| 53 |
-
"en": "
|
| 54 |
-
"zh": "
|
| 55 |
},
|
| 56 |
}
|
|
|
|
| 50 |
"zh": "English"
|
| 51 |
},
|
| 52 |
"lang_zh": {
|
| 53 |
+
"en": "简体中文",
|
| 54 |
+
"zh": "简体中文"
|
| 55 |
},
|
| 56 |
}
|
tab_smart_writer.py
CHANGED
|
@@ -49,7 +49,7 @@ def get_stats(text, lang):
|
|
| 49 |
|
| 50 |
def create_smart_writer_tab(lang_state: gr.State):
|
| 51 |
lang = lang_state.value
|
| 52 |
-
debounce_manager = DebounceManager(debounce_time=2.0, tick_time=0
|
| 53 |
|
| 54 |
with gr.Row(equal_height=False, elem_id="indicator-writing-tab"):
|
| 55 |
# --- Left Column: Entity Console ---
|
|
|
|
| 49 |
|
| 50 |
def create_smart_writer_tab(lang_state: gr.State):
|
| 51 |
lang = lang_state.value
|
| 52 |
+
debounce_manager = DebounceManager(debounce_time=2.0, tick_time=1.0, loading_text=get_text("writer_debounce_loading_text", lang))
|
| 53 |
|
| 54 |
with gr.Row(equal_height=False, elem_id="indicator-writing-tab"):
|
| 55 |
# --- Left Column: Entity Console ---
|
tab_welcome.py
CHANGED
|
@@ -7,44 +7,40 @@ def create_welcome_tab(initial_lang: str):
|
|
| 7 |
Returns a dictionary of all component handles that need dynamic updates.
|
| 8 |
"""
|
| 9 |
with gr.TabItem(get_text("welcome_tab_title", initial_lang)) as welcome_tab:
|
| 10 |
-
with gr.Column(elem_classes=["welcome-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
with gr.Row():
|
| 22 |
-
welcome_model_links_header_md = gr.Markdown(get_text('welcome_model_links_header', initial_lang))
|
| 23 |
-
with gr.Row():
|
| 24 |
-
welcome_hf_link_md = gr.Markdown(get_text('welcome_hf_link', initial_lang), padding=True, container=True)
|
| 25 |
-
welcome_hf_report_md = gr.Markdown(get_text('welcome_hf_report', initial_lang), padding=True, container=True)
|
| 26 |
-
welcome_x_account_md = gr.Markdown(get_text('welcome_x_account', initial_lang), padding=True, container=True)
|
| 27 |
-
|
| 28 |
-
gr.Markdown(" ")
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
# Return a dictionary for easier access in app.py
|
| 50 |
components = {
|
|
|
|
| 7 |
Returns a dictionary of all component handles that need dynamic updates.
|
| 8 |
"""
|
| 9 |
with gr.TabItem(get_text("welcome_tab_title", initial_lang)) as welcome_tab:
|
| 10 |
+
with gr.Column(elem_classes=["welcome-content"], scale=1):
|
| 11 |
+
welcome_header_md = gr.Markdown(f"# {get_text('welcome_header', initial_lang)}")
|
| 12 |
+
welcome_desc_md = gr.Markdown(get_text('welcome_description', initial_lang))
|
| 13 |
+
with gr.Row(equal_height=True):
|
| 14 |
+
welcome_chat_desc_md = gr.Markdown(get_text('welcome_chat_desc', initial_lang), padding=True, container=True)
|
| 15 |
+
welcome_code_desc_md = gr.Markdown(get_text('welcome_code_desc', initial_lang), padding=True, container=True)
|
| 16 |
+
welcome_writer_desc_md = gr.Markdown(get_text('welcome_writer_desc', initial_lang), padding=True, container=True)
|
| 17 |
+
|
| 18 |
+
gr.Markdown(" ")
|
| 19 |
+
welcome_model_links_header_md = gr.Markdown(get_text('welcome_model_links_header', initial_lang))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
with gr.Row(equal_height=True):
|
| 22 |
+
welcome_hf_link_md = gr.Markdown(get_text('welcome_hf_link', initial_lang), padding=True, container=True)
|
| 23 |
+
welcome_hf_report_md = gr.Markdown(get_text('welcome_hf_report', initial_lang), padding=True, container=True)
|
| 24 |
+
welcome_x_account_md = gr.Markdown(get_text('welcome_x_account', initial_lang), padding=True, container=True)
|
| 25 |
+
|
| 26 |
+
gr.Markdown(" ")
|
| 27 |
+
welcome_lang_select_md = gr.Markdown(get_text('welcome_select_language', initial_lang))
|
| 28 |
|
| 29 |
+
with gr.Row():
|
| 30 |
+
with gr.Column(elem_classes=["language-buttons"]):
|
| 31 |
+
en_button = gr.Button(get_text('lang_en', initial_lang))
|
| 32 |
+
zh_button = gr.Button(get_text('lang_zh', initial_lang))
|
| 33 |
+
|
| 34 |
+
en_button.click(
|
| 35 |
+
fn=None,
|
| 36 |
+
inputs=[],
|
| 37 |
+
js="() => { window.dispatchEvent(new CustomEvent('langChange.SpaceApp', { detail: { lang: 'en' } })); }"
|
| 38 |
+
)
|
| 39 |
+
zh_button.click(
|
| 40 |
+
fn=None,
|
| 41 |
+
inputs=[],
|
| 42 |
+
js="() => { window.dispatchEvent(new CustomEvent('langChange.SpaceApp', { detail: { lang: 'zh' } })); }"
|
| 43 |
+
)
|
| 44 |
|
| 45 |
# Return a dictionary for easier access in app.py
|
| 46 |
components = {
|