Commit
·
5ac0c97
1
Parent(s):
6521775
remove obsolete code
Browse files
src/distilabel_dataset_generator/apps/base.py
CHANGED
|
@@ -10,14 +10,11 @@ from distilabel.distiset import Distiset
|
|
| 10 |
from gradio import OAuthToken
|
| 11 |
from huggingface_hub import HfApi, upload_file
|
| 12 |
|
|
|
|
| 13 |
from distilabel_dataset_generator.utils import (
|
| 14 |
get_argilla_client,
|
| 15 |
-
list_orgs,
|
| 16 |
)
|
| 17 |
|
| 18 |
-
TEXTCAT_TASK = "text_classification"
|
| 19 |
-
SFT_TASK = "supervised_fine_tuning"
|
| 20 |
-
|
| 21 |
|
| 22 |
def validate_argilla_user_workspace_dataset(
|
| 23 |
dataset_name: str,
|
|
@@ -48,16 +45,6 @@ def validate_argilla_user_workspace_dataset(
|
|
| 48 |
return ""
|
| 49 |
|
| 50 |
|
| 51 |
-
def get_org_dropdown(oauth_token: Union[OAuthToken, None]):
|
| 52 |
-
orgs = list_orgs(oauth_token)
|
| 53 |
-
return gr.Dropdown(
|
| 54 |
-
label="Organization",
|
| 55 |
-
choices=orgs,
|
| 56 |
-
value=orgs[0] if orgs else None,
|
| 57 |
-
allow_custom_value=True,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
|
| 61 |
def push_pipeline_code_to_hub(
|
| 62 |
pipeline_code: str,
|
| 63 |
org_name: str,
|
|
|
|
| 10 |
from gradio import OAuthToken
|
| 11 |
from huggingface_hub import HfApi, upload_file
|
| 12 |
|
| 13 |
+
from distilabel_dataset_generator.constants import TEXTCAT_TASK
|
| 14 |
from distilabel_dataset_generator.utils import (
|
| 15 |
get_argilla_client,
|
|
|
|
| 16 |
)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
def validate_argilla_user_workspace_dataset(
|
| 20 |
dataset_name: str,
|
|
|
|
| 45 |
return ""
|
| 46 |
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
def push_pipeline_code_to_hub(
|
| 49 |
pipeline_code: str,
|
| 50 |
org_name: str,
|
src/distilabel_dataset_generator/constants.py
CHANGED
|
@@ -3,6 +3,10 @@ import warnings
|
|
| 3 |
|
| 4 |
import argilla as rg
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Hugging Face
|
| 7 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 8 |
if HF_TOKEN is None:
|
|
@@ -38,6 +42,9 @@ else:
|
|
| 38 |
else:
|
| 39 |
MAGPIE_PRE_QUERY_TEMPLATE = "llama3"
|
| 40 |
|
|
|
|
|
|
|
|
|
|
| 41 |
# Argilla
|
| 42 |
ARGILLA_API_URL = os.getenv("ARGILLA_API_URL")
|
| 43 |
ARGILLA_API_KEY = os.getenv("ARGILLA_API_KEY")
|
|
|
|
| 3 |
|
| 4 |
import argilla as rg
|
| 5 |
|
| 6 |
+
# Tasks
|
| 7 |
+
TEXTCAT_TASK = "text_classification"
|
| 8 |
+
SFT_TASK = "supervised_fine_tuning"
|
| 9 |
+
|
| 10 |
# Hugging Face
|
| 11 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 12 |
if HF_TOKEN is None:
|
|
|
|
| 42 |
else:
|
| 43 |
MAGPIE_PRE_QUERY_TEMPLATE = "llama3"
|
| 44 |
|
| 45 |
+
# Embeddings
|
| 46 |
+
STATIC_EMBEDDING_MODEL = "minishlab/potion-base-8M"
|
| 47 |
+
|
| 48 |
# Argilla
|
| 49 |
ARGILLA_API_URL = os.getenv("ARGILLA_API_URL")
|
| 50 |
ARGILLA_API_KEY = os.getenv("ARGILLA_API_KEY")
|
src/distilabel_dataset_generator/pipelines/embeddings.py
CHANGED
|
@@ -3,8 +3,9 @@ from typing import List
|
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
from sentence_transformers.models import StaticEmbedding
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
| 8 |
model = SentenceTransformer(modules=[static_embedding])
|
| 9 |
|
| 10 |
|
|
|
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
from sentence_transformers.models import StaticEmbedding
|
| 5 |
|
| 6 |
+
from distilabel_dataset_generator.constants import STATIC_EMBEDDING_MODEL
|
| 7 |
+
|
| 8 |
+
static_embedding = StaticEmbedding.from_model2vec(STATIC_EMBEDDING_MODEL)
|
| 9 |
model = SentenceTransformer(modules=[static_embedding])
|
| 10 |
|
| 11 |
|