Spaces:
Runtime error
Runtime error
Small improvements
Browse files
src/distilabel_dataset_generator/apps/sft.py
CHANGED
|
@@ -18,6 +18,7 @@ from src.distilabel_dataset_generator.pipelines.sft import (
|
|
| 18 |
from src.distilabel_dataset_generator.utils import (
|
| 19 |
get_login_button,
|
| 20 |
get_org_dropdown,
|
|
|
|
| 21 |
)
|
| 22 |
|
| 23 |
|
|
@@ -65,7 +66,7 @@ def generate_dataset(
|
|
| 65 |
private=True,
|
| 66 |
org_name=None,
|
| 67 |
repo_name=None,
|
| 68 |
-
oauth_token: Union[gr.OAuthToken, None]=None,
|
| 69 |
progress=gr.Progress(),
|
| 70 |
):
|
| 71 |
repo_id = (
|
|
@@ -146,6 +147,12 @@ def generate_pipeline_code() -> str:
|
|
| 146 |
|
| 147 |
return pipeline_code
|
| 148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
css = """
|
| 150 |
.main_ui_logged_out{opacity: 0.3; pointer-events: none}
|
| 151 |
"""
|
|
@@ -293,3 +300,4 @@ with gr.Blocks(
|
|
| 293 |
)
|
| 294 |
|
| 295 |
app.load(get_org_dropdown, outputs=[org_name])
|
|
|
|
|
|
| 18 |
from src.distilabel_dataset_generator.utils import (
|
| 19 |
get_login_button,
|
| 20 |
get_org_dropdown,
|
| 21 |
+
get_token
|
| 22 |
)
|
| 23 |
|
| 24 |
|
|
|
|
| 66 |
private=True,
|
| 67 |
org_name=None,
|
| 68 |
repo_name=None,
|
| 69 |
+
oauth_token: Union[gr.OAuthToken, None] = None,
|
| 70 |
progress=gr.Progress(),
|
| 71 |
):
|
| 72 |
repo_id = (
|
|
|
|
| 147 |
|
| 148 |
return pipeline_code
|
| 149 |
|
| 150 |
+
def swap_visibilty(profile: Union[gr.OAuthProfile, None]):
|
| 151 |
+
if profile is None:
|
| 152 |
+
return gr.update(elem_classes=["main_ui_logged_out"])
|
| 153 |
+
else:
|
| 154 |
+
return gr.update(elem_classes=["main_ui_logged_in"])
|
| 155 |
+
|
| 156 |
css = """
|
| 157 |
.main_ui_logged_out{opacity: 0.3; pointer-events: none}
|
| 158 |
"""
|
|
|
|
| 300 |
)
|
| 301 |
|
| 302 |
app.load(get_org_dropdown, outputs=[org_name])
|
| 303 |
+
app.load(fn=swap_visibilty, outputs=main_ui)
|