Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -12,15 +12,6 @@ DATASET_REPO = "gursul/german_exercise_dataset"
|
|
| 12 |
ENGLISH_WORDS_FILE = "en_de.json"
|
| 13 |
GERMAN_WORDS_FILE = "de_en.json"
|
| 14 |
|
| 15 |
-
css = """
|
| 16 |
-
.meme-img img {
|
| 17 |
-
object-fit: contain;
|
| 18 |
-
width: 100%;
|
| 19 |
-
height: auto;
|
| 20 |
-
max-height: 300px; /* adjust max height */
|
| 21 |
-
}
|
| 22 |
-
"""
|
| 23 |
-
|
| 24 |
# Authenticate once at startup
|
| 25 |
if "HF_TOKEN" in os.environ:
|
| 26 |
login(token=os.environ["HF_TOKEN"])
|
|
@@ -348,7 +339,7 @@ MEME_PATH = hf_hub_download(
|
|
| 348 |
)
|
| 349 |
|
| 350 |
# Gradio UI
|
| 351 |
-
with gr.Blocks(
|
| 352 |
with gr.Tab("Word Translation"):
|
| 353 |
with gr.Row():
|
| 354 |
# ========= EN → DE =========
|
|
@@ -386,7 +377,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 386 |
de_submit_btn = gr.Button("Check Answer (DE→EN)")
|
| 387 |
|
| 388 |
with gr.Tab("Words Dataset"):
|
| 389 |
-
with gr.Row(
|
| 390 |
with gr.Column():
|
| 391 |
english_in = gr.Textbox(label="English Word")
|
| 392 |
type_in = gr.Dropdown(label="Word Type", choices=["noun", "verb", "other"], value="noun")
|
|
@@ -405,7 +396,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 405 |
show_download_button=False,
|
| 406 |
show_label=False,
|
| 407 |
show_share_button=False,
|
| 408 |
-
show_fullscreen_button=False
|
|
|
|
| 409 |
)
|
| 410 |
|
| 411 |
with gr.Row(equal_height=True):
|
|
|
|
| 12 |
ENGLISH_WORDS_FILE = "en_de.json"
|
| 13 |
GERMAN_WORDS_FILE = "de_en.json"
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Authenticate once at startup
|
| 16 |
if "HF_TOKEN" in os.environ:
|
| 17 |
login(token=os.environ["HF_TOKEN"])
|
|
|
|
| 339 |
)
|
| 340 |
|
| 341 |
# Gradio UI
|
| 342 |
+
with gr.Blocks() as demo:
|
| 343 |
with gr.Tab("Word Translation"):
|
| 344 |
with gr.Row():
|
| 345 |
# ========= EN → DE =========
|
|
|
|
| 377 |
de_submit_btn = gr.Button("Check Answer (DE→EN)")
|
| 378 |
|
| 379 |
with gr.Tab("Words Dataset"):
|
| 380 |
+
with gr.Row():
|
| 381 |
with gr.Column():
|
| 382 |
english_in = gr.Textbox(label="English Word")
|
| 383 |
type_in = gr.Dropdown(label="Word Type", choices=["noun", "verb", "other"], value="noun")
|
|
|
|
| 396 |
show_download_button=False,
|
| 397 |
show_label=False,
|
| 398 |
show_share_button=False,
|
| 399 |
+
show_fullscreen_button=False,
|
| 400 |
+
height=200
|
| 401 |
)
|
| 402 |
|
| 403 |
with gr.Row(equal_height=True):
|