davidberenstein1957 HF staff commited on
Commit
60fd999
1 Parent(s): 6d8f6c2

feat: upgrad to gradio 5.0

Browse files
README.md CHANGED
@@ -5,7 +5,7 @@ emoji: 🧬
5
  colorFrom: yellow
6
  colorTo: pink
7
  sdk: gradio
8
- sdk_version: 4.44.0
9
  app_file: app.py
10
  pinned: true
11
  license: apache-2.0
 
5
  colorFrom: yellow
6
  colorTo: pink
7
  sdk: gradio
8
+ sdk_version: 5.5.0
9
  app_file: app.py
10
  pinned: true
11
  license: apache-2.0
pdm.lock CHANGED
The diff for this file is too large to render. See raw diff
 
pyproject.toml CHANGED
@@ -6,8 +6,8 @@ authors = [
6
  {name = "davidberenstein1957", email = "david.m.berenstein@gmail.com"},
7
  ]
8
  dependencies = [
9
- "distilabel[hf-inference-endpoints,argilla]==1.4.0",
10
- "gradio[oauth]<5,>=4.38",
11
  "transformers>=4.44.2",
12
  "sentence-transformers>=3.2.0",
13
  "model2vec>=0.2.4",
 
6
  {name = "davidberenstein1957", email = "david.m.berenstein@gmail.com"},
7
  ]
8
  dependencies = [
9
+ "distilabel[hf-inference-endpoints,argilla]>=1.4.1",
10
+ "gradio[oauth]>=5.5.0",
11
  "transformers>=4.44.2",
12
  "sentence-transformers>=3.2.0",
13
  "model2vec>=0.2.4",
src/distilabel_dataset_generator/apps/base.py CHANGED
@@ -13,9 +13,9 @@ from huggingface_hub import HfApi, upload_file
13
  from src.distilabel_dataset_generator.utils import (
14
  _LOGGED_OUT_CSS,
15
  get_argilla_client,
 
16
  list_orgs,
17
  swap_visibilty,
18
- get_login_button,
19
  )
20
 
21
  TEXTCAT_TASK = "text_classification"
@@ -258,7 +258,7 @@ def get_iterate_on_sample_dataset_ui(
258
  with gr.Row():
259
  gr.Column(scale=1)
260
  btn_generate_system_prompt = gr.Button(
261
- value="Generate system prompt and sample dataset"
262
  )
263
  gr.Column(scale=1)
264
 
@@ -283,7 +283,7 @@ def get_iterate_on_sample_dataset_ui(
283
  with gr.Row():
284
  gr.Column(scale=1)
285
  btn_generate_sample_dataset = gr.Button(
286
- value="Generate sample dataset",
287
  )
288
  gr.Column(scale=1)
289
 
@@ -432,17 +432,17 @@ def push_dataset_to_hub(
432
  {"text": Value("string"), "label": ClassLabel(names=labels)}
433
  )
434
  else:
435
- features = Features({
436
- "text": Value("string"),
437
- "labels": Sequence(feature=ClassLabel(names=labels))
438
- })
439
- distiset = Distiset({
440
- "default": Dataset.from_pandas(dataframe, features=features)
441
- })
 
 
442
  else:
443
- distiset = Distiset({
444
- "default": Dataset.from_pandas(dataframe)
445
- })
446
  progress(0.2, desc="Pushing dataset to hub")
447
  distiset.push_to_hub(
448
  repo_id=repo_id,
 
13
  from src.distilabel_dataset_generator.utils import (
14
  _LOGGED_OUT_CSS,
15
  get_argilla_client,
16
+ get_login_button,
17
  list_orgs,
18
  swap_visibilty,
 
19
  )
20
 
21
  TEXTCAT_TASK = "text_classification"
 
258
  with gr.Row():
259
  gr.Column(scale=1)
260
  btn_generate_system_prompt = gr.Button(
261
+ value="Generate system prompt and sample dataset", variant="primary"
262
  )
263
  gr.Column(scale=1)
264
 
 
283
  with gr.Row():
284
  gr.Column(scale=1)
285
  btn_generate_sample_dataset = gr.Button(
286
+ value="Generate sample dataset", variant="primary"
287
  )
288
  gr.Column(scale=1)
289
 
 
432
  {"text": Value("string"), "label": ClassLabel(names=labels)}
433
  )
434
  else:
435
+ features = Features(
436
+ {
437
+ "text": Value("string"),
438
+ "labels": Sequence(feature=ClassLabel(names=labels)),
439
+ }
440
+ )
441
+ distiset = Distiset(
442
+ {"default": Dataset.from_pandas(dataframe, features=features)}
443
+ )
444
  else:
445
+ distiset = Distiset({"default": Dataset.from_pandas(dataframe)})
 
 
446
  progress(0.2, desc="Pushing dataset to hub")
447
  distiset.push_to_hub(
448
  repo_id=repo_id,
src/distilabel_dataset_generator/apps/textcat.py CHANGED
@@ -316,6 +316,7 @@ def validate_input_labels(labels):
316
  )
317
  return labels
318
 
 
319
  def update_max_num_labels(labels):
320
  return gr.update(maximum=len(labels) if labels else 1)
321
 
@@ -392,6 +393,7 @@ with app:
392
  with gr.Blocks():
393
  btn_suggested_labels = gr.Button(
394
  value="Add suggested labels",
 
395
  size="sm",
396
  )
397
  num_labels = gr.Number(
 
316
  )
317
  return labels
318
 
319
+
320
  def update_max_num_labels(labels):
321
  return gr.update(maximum=len(labels) if labels else 1)
322
 
 
393
  with gr.Blocks():
394
  btn_suggested_labels = gr.Button(
395
  value="Add suggested labels",
396
+ variant="primary",
397
  size="sm",
398
  )
399
  num_labels = gr.Number(