from concurrent.futures import ThreadPoolExecutor, as_completed
from datasets import load_dataset, Dataset
from typing import Optional
from threading import Lock
from tqdm import tqdm
import cohere
import time
import os
PROMPT_TEMPLATE = """Translate the following text from English to {target_language}.
Provide only the translated text without any additional explanation or formatting:
'{prompt}'"""
request_counter = 0
counter_lock = Lock()
def generate_w_cohere(prompt: str, model: str = "c4ai-aya-expanse-8b"):
global request_counter
with counter_lock:
if request_counter >= 475: # Rate limit for Cohere API is 500 requests per minute
time.sleep(60)
request_counter = 0
request_counter += 1
co = cohere.ClientV2(os.environ["COHERE_API_KEY"])
response = co.chat(
model=model,
messages=[{"role": "user", "content": prompt}],
)
return response.message.content[0].text
def translate_w_cohere(
dataset_path: str="PRLM/distilabel-intel-orca-dpo-pairs-balanced-subsets",
subset: str="1k",
split: str="train",
prompt_column: str="prompt",
response_column: str="completion",
score_column: str="score",
):
ds = load_dataset(dataset_path, subset, split=split).select_columns([prompt_column, response_column, score_column])
for language in ["German", "Italian", "Portuguese", "Hindi", "Spanish", "Thai"]: # "English", "French",
if language != "English":
prompts = [PROMPT_TEMPLATE.format(target_language=language, prompt=prompt) for prompt in ds[prompt_column]]
responses = [PROMPT_TEMPLATE.format(target_language=language, prompt=response) for response in ds[response_column]]
prompt_translations = [None] * len(prompts)
response_translations = [None] * len(responses)
with ThreadPoolExecutor() as executor:
prompt_futures = {executor.submit(generate_w_cohere, prompt): prompt for prompt in prompts}
response_futures = {executor.submit(generate_w_cohere, response): response for response in responses}
for future in tqdm(as_completed(prompt_futures), total=len(prompts), desc=f"Translating prompts to {language}", unit="prompt"):
index = prompts.index(prompt_futures[future])
prompt_translations[index] = future.result()
for future in tqdm(as_completed(response_futures), total=len(responses), desc=f"Translating responses to {language}", unit="response"):
index = responses.index(response_futures[future])
response_translations[index] = future.result()
else:
prompt_translations = ds[prompt_column]
response_translations = ds[response_column]
translated_dataset = Dataset.from_dict({
prompt_column: prompt_translations,
response_column: response_translations,
score_column: ds[score_column],
})
translated_dataset.push_to_hub(
dataset_path+"-translated",
subset+"-"+language,
split="train",
private=True,
token=os.environ["HF_TOKEN"],
)
if __name__ == "__main__":
import fire
fire.Fire(translate_w_cohere)
PRLM/distilabel-intel-orca-dpo-pairs-balanced-subsets-translated
DPO and ORPO preference mixes to recover capability after ablation.Answer pairs that recover quality after the edit.
Description
from concurrent.futures import ThreadPoolExecutor, as_completed
from datasets import load_dataset, Dataset
from typing import Optional
from threading import Lock
from tqdm import tqdm
import cohere
import time
import os
PROMPT_TEMPLATE = """Translate the following text from English to {target_language}.
Provide only the translated text without any additional explanation or formatting:
'{prompt}'"""
request_counter = 0
counter_lock = Lock()
def generate_w_cohere(prompt: str, model: str =… See the full description on the dataset page: https://huggingface.co/datasets/PRLM/distilabel-intel-orca-dpo-pairs-balanced-subsets-translated.
Structure
| SplitPart | Rows | Size |
|---|---|---|
| train | 1,000 | 1.6 MB |
| SplitPart | Rows | Size |
|---|---|---|
| train | 1,000 | 1.6 MB |
| SplitPart | Rows | Size |
|---|---|---|
| train | 1,000 | 1.5 MB |
| SplitPart | Rows | Size |
|---|---|---|
| train | 1,000 | 3.6 MB |
| SplitPart | Rows | Size |
|---|---|---|
| train | 1,000 | 1.5 MB |
| SplitPart | Rows | Size |
|---|---|---|
| train | 1,000 | 1.5 MB |
| SplitPart | Rows | Size |
|---|---|---|
| train | 1,000 | 1.5 MB |
| SplitPart | Rows | Size |
|---|---|---|
| train | 1,000 | 3.4 MB |
Used by uncensored models
No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.No model in our catalog lists this dataset yet. It may be used without being listed, used for other work, or simply be new. The list fills in by itself as models are added.
MetadataDetails
Related datasets
Read further
Download the dataset
Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.Each of these lines of code downloads the dataset straight from Hugging Face, with your own Hugging Face login.
from datasets import load_dataset
ds = load_dataset("PRLM/distilabel-intel-orca-dpo-pairs-balanced-subsets-translated")from huggingface_hub import snapshot_download
snapshot_download(repo_id="PRLM/distilabel-intel-orca-dpo-pairs-balanced-subsets-translated", repo_type="dataset")git clone https://huggingface.co/datasets/PRLM/distilabel-intel-orca-dpo-pairs-balanced-subsets-translatedFiles by folder
Showing the first 5,000 files. Full list on Hugging Face ↗
1k-English/ 1 file 988.5 KB
| train-00000-of-00001.parquet | 988.5 KB | parquet | download |
1k-French/ 1 file 937.4 KB
| train-00000-of-00001.parquet | 937.4 KB | parquet | download |
1k-German/ 1 file 905.4 KB
| train-00000-of-00001.parquet | 905.4 KB | parquet | download |
1k-Hindi/ 1 file 1.3 MB
| train-00000-of-00001.parquet | 1.3 MB | parquet | download |
1k-Italian/ 1 file 891.3 KB
| train-00000-of-00001.parquet | 891.3 KB | parquet | download |
1k-Portuguese/ 1 file 897.9 KB
| train-00000-of-00001.parquet | 897.9 KB | parquet | download |
1k-Spanish/ 1 file 881.7 KB
| train-00000-of-00001.parquet | 881.7 KB | parquet | download |
1k-Thai/ 1 file 1.1 MB
| train-00000-of-00001.parquet | 1.1 MB | parquet | download |
No file list for this dataset yet.
This repository is private or no longer exists on Hugging Face.This dataset is private or no longer exists on Hugging Face.
Open on Hugging Face ↗READMEAuthor's description
README historyEdit history
Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.Every night we save the author's description of every dataset in the catalog. When it changes, we keep the new text and compare it with the one before. This shows what each author chose to say about their dataset, and how that changed over time.
-
2025-05-06 Update README.md
Loading... -
2025-05-06 Upload dataset
Loading... -
2025-05-06 Upload dataset
Loading... -
2025-05-06 Upload dataset
Loading... -
2025-05-06 Upload dataset
Loading... -
2025-05-06 Upload dataset
Loading... -
2025-05-06 Upload dataset
Loading... -
2025-05-06 Upload dataset
Loading... -
2025-05-06 Upload dataset
Loading... -
2025-04-16 Update README.md
Loading... -
2025-04-15 Upload dataset
Loading... -
2025-04-15 Upload dataset
Loading... -
2025-04-15 Upload dataset
Loading... -
2025-04-15 Upload dataset
Loading... -
2025-04-15 Upload dataset
Loading... -
2025-04-15 Upload dataset
Loading... -
2025-04-15 Upload dataset
Loading... -
2025-04-15 Upload dataset
Loading... -
2025-04-15 initial commit
Loading...
Community discussions
Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, licence clarifications. Click any thread to expand and read the full conversation inline. Newest first.Conversations people started on Hugging Face: bug reports, questions about using the data, suggested changes to the author's description, questions about the licence. Open a thread to read it here. Newest first.
-
2025-04-17 [bot] Conversion to Parquet
Loading...
source: Hugging Face