Reza2kn commited on
Commit
c4db08d
·
verified ·
1 Parent(s): f812300

Place LoginButton inside Dataset tab

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -13,7 +13,6 @@ from pathlib import Path
13
  from typing import List, Optional, Tuple
14
 
15
  import gradio as gr
16
- from gradio.context import get_blocks_context
17
  import librosa
18
  import numpy as np
19
  import soundfile as sf
@@ -1399,14 +1398,6 @@ with gr.Blocks(title="Representation Chizzler") as demo:
1399
  "to clean and publish a dataset to the Hugging Face Hub."
1400
  )
1401
  with gr.Column():
1402
- with gr.Row():
1403
- login_button = gr.LoginButton()
1404
- if get_blocks_context() is None:
1405
- try:
1406
- login_button.activate()
1407
- except Exception:
1408
- pass
1409
-
1410
  with gr.Tabs():
1411
  with gr.Tab("Single File"):
1412
  audio_input = gr.Audio(label="Upload Audio File", type="filepath")
@@ -1470,6 +1461,8 @@ with gr.Blocks(title="Representation Chizzler") as demo:
1470
  )
1471
 
1472
  with gr.Tab("Dataset to Hub"):
 
 
1473
  dataset_id_input = gr.Textbox(
1474
  label="Dataset ID or URL",
1475
  value="https://huggingface.co/datasets/MohammadGholizadeh/fleurs-farsi",
 
13
  from typing import List, Optional, Tuple
14
 
15
  import gradio as gr
 
16
  import librosa
17
  import numpy as np
18
  import soundfile as sf
 
1398
  "to clean and publish a dataset to the Hugging Face Hub."
1399
  )
1400
  with gr.Column():
 
 
 
 
 
 
 
 
1401
  with gr.Tabs():
1402
  with gr.Tab("Single File"):
1403
  audio_input = gr.Audio(label="Upload Audio File", type="filepath")
 
1461
  )
1462
 
1463
  with gr.Tab("Dataset to Hub"):
1464
+ with gr.Row():
1465
+ gr.LoginButton()
1466
  dataset_id_input = gr.Textbox(
1467
  label="Dataset ID or URL",
1468
  value="https://huggingface.co/datasets/MohammadGholizadeh/fleurs-farsi",