davidberenstein1957 HF staff commited on
Commit
f230d42
·
1 Parent(s): 545e114

fix correct `OauthToken.token` attribute getter

Browse files
src/synthetic_dataset_generator/apps/base.py CHANGED
@@ -1,19 +1,13 @@
1
  import io
2
  import uuid
3
- from typing import List, Union
4
 
5
  import argilla as rg
6
  import gradio as gr
7
- import pandas as pd
8
- from datasets import ClassLabel, Dataset, Features, Sequence, Value
9
- from distilabel.distiset import Distiset
10
  from gradio import OAuthToken
11
  from huggingface_hub import HfApi, upload_file
12
 
13
- from synthetic_dataset_generator.constants import TEXTCAT_TASK
14
- from synthetic_dataset_generator.utils import (
15
- get_argilla_client,
16
- )
17
 
18
 
19
  def validate_argilla_user_workspace_dataset(
@@ -52,7 +46,7 @@ def push_pipeline_code_to_hub(
52
  oauth_token: Union[OAuthToken, None] = None,
53
  progress=gr.Progress(),
54
  ):
55
- repo_id = validate_push_to_hub(org_name, repo_name)
56
  progress(0.1, desc="Uploading pipeline code")
57
  with io.BytesIO(pipeline_code.encode("utf-8")) as f:
58
  upload_file(
 
1
  import io
2
  import uuid
3
+ from typing import Union
4
 
5
  import argilla as rg
6
  import gradio as gr
 
 
 
7
  from gradio import OAuthToken
8
  from huggingface_hub import HfApi, upload_file
9
 
10
+ from synthetic_dataset_generator.utils import get_argilla_client
 
 
 
11
 
12
 
13
  def validate_argilla_user_workspace_dataset(
 
46
  oauth_token: Union[OAuthToken, None] = None,
47
  progress=gr.Progress(),
48
  ):
49
+ repo_id: str | None = validate_push_to_hub(org_name, repo_name)
50
  progress(0.1, desc="Uploading pipeline code")
51
  with io.BytesIO(pipeline_code.encode("utf-8")) as f:
52
  upload_file(
src/synthetic_dataset_generator/apps/eval.py CHANGED
@@ -350,7 +350,7 @@ def push_dataset_to_hub(
350
  dataframe: pd.DataFrame,
351
  org_name: str,
352
  repo_name: str,
353
- oauth_token,
354
  private: bool,
355
  pipeline_code: str,
356
  ):
@@ -363,7 +363,7 @@ def push_dataset_to_hub(
363
  token=oauth_token.token,
364
  create_pr=False,
365
  )
366
- push_pipeline_code_to_hub(pipeline_code, org_name, repo_name, oauth_token.token)
367
 
368
 
369
  def push_dataset(
 
350
  dataframe: pd.DataFrame,
351
  org_name: str,
352
  repo_name: str,
353
+ oauth_token: Union[gr.OAuthToken, None],
354
  private: bool,
355
  pipeline_code: str,
356
  ):
 
363
  token=oauth_token.token,
364
  create_pr=False,
365
  )
366
+ push_pipeline_code_to_hub(pipeline_code, org_name, repo_name, oauth_token)
367
 
368
 
369
  def push_dataset(
src/synthetic_dataset_generator/apps/sft.py CHANGED
@@ -207,7 +207,7 @@ def push_dataset_to_hub(
207
  dataframe: pd.DataFrame,
208
  org_name: str,
209
  repo_name: str,
210
- oauth_token: gr.OAuthToken,
211
  private: bool,
212
  pipeline_code: str,
213
  ):
@@ -222,7 +222,7 @@ def push_dataset_to_hub(
222
  token=oauth_token.token,
223
  create_pr=False,
224
  )
225
- push_pipeline_code_to_hub(pipeline_code, org_name, repo_name, oauth_token.token)
226
  return original_dataframe
227
 
228
 
 
207
  dataframe: pd.DataFrame,
208
  org_name: str,
209
  repo_name: str,
210
+ oauth_token: Union[gr.OAuthToken, None],
211
  private: bool,
212
  pipeline_code: str,
213
  ):
 
222
  token=oauth_token.token,
223
  create_pr=False,
224
  )
225
+ push_pipeline_code_to_hub(pipeline_code, org_name, repo_name, oauth_token)
226
  return original_dataframe
227
 
228
 
src/synthetic_dataset_generator/apps/textcat.py CHANGED
@@ -197,7 +197,7 @@ def push_dataset_to_hub(
197
  token=oauth_token.token,
198
  create_pr=False,
199
  )
200
- push_pipeline_code_to_hub(pipeline_code, org_name, repo_name, oauth_token.token)
201
 
202
 
203
  def push_dataset(
 
197
  token=oauth_token.token,
198
  create_pr=False,
199
  )
200
+ push_pipeline_code_to_hub(pipeline_code, org_name, repo_name, oauth_token)
201
 
202
 
203
  def push_dataset(