Commit
•
abbcdf5
1
Parent(s):
b4ac9ca
fix: create user with mock password
Browse files
src/distilabel_dataset_generator/apps/sft.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import ast
|
2 |
import io
|
|
|
3 |
from typing import Dict, List, Union
|
4 |
|
5 |
import argilla as rg
|
@@ -377,12 +378,14 @@ def validate_argilla_dataset_name(
|
|
377 |
# Create user if it doesn't exist
|
378 |
rg_user = client.users(username=hf_user)
|
379 |
if rg_user is None:
|
380 |
-
rg_user = client.users.add(
|
|
|
|
|
381 |
# Create workspace if it doesn't exist
|
382 |
workspace = client.workspaces(name=hf_user)
|
383 |
if workspace is None:
|
384 |
workspace = client.workspaces.add(rg.Workspace(name=hf_user))
|
385 |
-
workspace.add_user(
|
386 |
# Check if dataset exists
|
387 |
dataset = client.datasets(name=dataset_name, workspace=hf_user)
|
388 |
if dataset and not add_to_existing_dataset:
|
|
|
1 |
import ast
|
2 |
import io
|
3 |
+
import uuid
|
4 |
from typing import Dict, List, Union
|
5 |
|
6 |
import argilla as rg
|
|
|
378 |
# Create user if it doesn't exist
|
379 |
rg_user = client.users(username=hf_user)
|
380 |
if rg_user is None:
|
381 |
+
rg_user = client.users.add(
|
382 |
+
rg.User(username=hf_user, role="admin", password=str(uuid.uuid4()))
|
383 |
+
)
|
384 |
# Create workspace if it doesn't exist
|
385 |
workspace = client.workspaces(name=hf_user)
|
386 |
if workspace is None:
|
387 |
workspace = client.workspaces.add(rg.Workspace(name=hf_user))
|
388 |
+
workspace.add_user(rg_user)
|
389 |
# Check if dataset exists
|
390 |
dataset = client.datasets(name=dataset_name, workspace=hf_user)
|
391 |
if dataset and not add_to_existing_dataset:
|