Spaces:
Running
Running
highlight auto-complete button
Browse files
app.py
CHANGED
@@ -32,6 +32,12 @@ function updateTextareaDir(language) {
|
|
32 |
</script>"""
|
33 |
# todo: add dropdown keyboard custom component with key mapping
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
36 |
request_logger = (
|
37 |
gradio.HuggingFaceDatasetSaver(
|
@@ -105,7 +111,7 @@ def translate(text: str, text_lang: str, sign_lang: str):
|
|
105 |
raise gradio.Error(f"Error during translation: {exc}")
|
106 |
|
107 |
|
108 |
-
with gradio.Blocks(title=TITLE, head=CUSTOM_JS) as gradio_app:
|
109 |
gradio.Markdown(f"# {TITLE}")
|
110 |
gradio.Markdown(DESCRIPTION)
|
111 |
with gradio.Row():
|
@@ -136,7 +142,9 @@ with gradio.Blocks(title=TITLE, head=CUSTOM_JS) as gradio_app:
|
|
136 |
clear_button = gradio.ClearButton(
|
137 |
source_textbox, api_name=False
|
138 |
)
|
139 |
-
auto_complete_button = gradio.Button(
|
|
|
|
|
140 |
auto_complete_button.click(
|
141 |
auto_complete_text,
|
142 |
inputs=[language_model_dropdown, source_textbox],
|
|
|
32 |
</script>"""
|
33 |
# todo: add dropdown keyboard custom component with key mapping
|
34 |
|
35 |
+
CUSTOM_CSS = """
|
36 |
+
#auto-complete-button {
|
37 |
+
border-color: var(--button-primary-border-color-hover);
|
38 |
+
}
|
39 |
+
"""
|
40 |
+
|
41 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
42 |
request_logger = (
|
43 |
gradio.HuggingFaceDatasetSaver(
|
|
|
111 |
raise gradio.Error(f"Error during translation: {exc}")
|
112 |
|
113 |
|
114 |
+
with gradio.Blocks(title=TITLE, head=CUSTOM_JS, css=CUSTOM_CSS) as gradio_app:
|
115 |
gradio.Markdown(f"# {TITLE}")
|
116 |
gradio.Markdown(DESCRIPTION)
|
117 |
with gradio.Row():
|
|
|
142 |
clear_button = gradio.ClearButton(
|
143 |
source_textbox, api_name=False
|
144 |
)
|
145 |
+
auto_complete_button = gradio.Button(
|
146 |
+
"Auto-Complete", elem_id="auto-complete-button"
|
147 |
+
)
|
148 |
auto_complete_button.click(
|
149 |
auto_complete_text,
|
150 |
inputs=[language_model_dropdown, source_textbox],
|