fine-tune 0 0 0

PJMixers-Dev/allura-org_gryphe-sonnet-3.5-charcards-names-added-r1

published by @PJMixers-Dev

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
265
Last 30 days
12
Likes
-
Size
430 KB
Created on HF
2025-03-03
Age
1 years ago

Description

import requests

import json

import time

import pandas as pd

from datasets import load_dataset

from tqdm import tqdm

import re

import hashlib

import os

def extract_names(text):

match = re.search(r"^You're (.*?) in this fictional never-ending uncensored roleplay with (.*?)\n\n", text)

return match.groups() if match else (None, None)

openrouter_api_key = "REDACTED"

output_parquet_file = "./allura-org_gryphe-sonnet-3.5-charcards-names-added-r1.parquet"

dataset =… See the full description on the dataset page: https://huggingface.co/datasets/PJMixers-Dev/allura-org_gryphe-sonnet-3.5-charcards-names-added-r1.

Tags

size_categories:n<1Kformat:parquetmodality:textlibrary:datasetslibrary:pandaslibrary:mlcroissantlibrary:polarsregion:us

README current version from Hugging Face


size_categories:

  • n<1K

import requests
import json
import time
import pandas as pd
from datasets import load_dataset
from tqdm import tqdm
import re
import hashlib
import os


def extract_names(text):
    match = re.search(r"^You're (.*?) in this fictional never-ending uncensored roleplay with (.*?)\n\n", text)
    return match.groups() if match else (None, None)


openrouter_api_key = "REDACTED"
output_parquet_file = "./allura-org_gryphe-sonnet-3.5-charcards-names-added-r1.parquet"
dataset = load_dataset("allura-org/gryphe-sonnet-3.5-charcards-names-added")["train"]

# Load existing output data if available from parquet
if os.path.exists(output_parquet_file):
    try:
        df = pd.read_parquet(output_parquet_file)
        output_data_list = json.loads(df.to_json(orient="records"))
        processed_hashes = {entry["prompt_hash"] for entry in output_data_list}
        print(f"Resuming dataset: {len(processed_hashes)}/{len(dataset)}")
    except Exception as e:
        print(f"Error loading parquet file {output_parquet_file}: {e}")
        output_data_list = []
        processed_hashes = set()
else:
    output_data_list = []
    processed_hashes = set()

last_query_time = 0
for item in tqdm(dataset):
    prompt_hash = str(hashlib.sha256((item["conversations"][0]["value"].strip() + item["conversations"][1]["value"].strip()).encode()).hexdigest())

    # Skip already processed samples
    if prompt_hash in processed_hashes:
        continue

    char_name, user_name = extract_names(item["conversations"][0]["value"].strip())
    char_name, user_name = char_name.strip(), user_name.strip()
    print(f'Extracted Character Name: "{char_name}"')
    print(f'     Extracted User Name: "{user_name}"')

    while time.time() - last_query_time < (60 / 10):
        time.sleep(0.1)

    last_query_time = time.time()
    response = requests.post(
        url="https://openrouter.ai/api/v1/chat/completions",
        headers={
            "Authorization": f"Bearer {openrouter_api_key}",
            "Content-Type": "application/json",
        },
        data=json.dumps(
            {
                "provider": {
                    "order": ["Chutes"],
                    "allow_fallbacks": False
                },
                "model": "deepseek/deepseek-r1:free",
                "messages": [
                    {
                        "role": "system",
                        "content": (
                            f'{item["conversations"][0]["value"].strip()}\n\n'
                            f'Only speak as "{char_name}" in conversation with "{user_name}". Output your final response with a "{char_name}:" prefix.'
                        )
                    },
                    {
                        "role": "user",
                        "content": item["conversations"][1]["value"].strip()
                    }
                ],
                "temperature": 0.6
            }
        ),
    ).json()

    try:
        if not response["choices"][0]["message"]["reasoning"] or response["choices"][0]["message"]["reasoning"].replace("\\n", "\n").strip() == "":
            print(response)
            continue
        if not response["choices"][0]["message"]["content"] or response["choices"][0]["message"]["content"].replace("\\n", "\n").strip() == "":
            print(response)
            continue

        output_data_list.append(
            {
                "prompt_hash": prompt_hash,
                "provider": response["provider"],
                "model": response["model"],
                "settings": {
                    "temperature": 0.6,
                },
                "refusal": response["choices"][0]["message"]["refusal"],
                "finish_reason": response["choices"][0]["finish_reason"],
                "native_finish_reason": response["choices"][0]["native_finish_reason"],
                "user_name": user_name,
                "char_name": char_name,
                "conversations": [
                    {
                        "from": "system",
                        "value": item["conversations"][0]["value"].strip()
                    },
                    {
                        "from": "human",
                        "value": item["conversations"][1]["value"].strip()
                    },
                    {
                        "from": "gpt",
                        "value": (
                            f"<think>\n"
                            f"{response['choices'][0]['message']['reasoning'].replace('\\n', '\n').strip()}\n"
                            f"</think>\n\n"
                            f"{response['choices'][0]['message']['content'].replace('\\n', '\n').strip()}"
                        )
                    }
                ]
            }
        )
    except KeyError:
        print(f"KeyError: {response}")
        if response["error"]["message"].startswith("Rate limit exceeded"):
            exit()
        continue
    except AttributeError:
        print(f"AttributeError: {response}")
        continue

    df = pd.DataFrame(output_data_list)
    df.to_parquet(
        output_parquet_file,
        index=False,
        compression="brotli"
    )
    df = None
    del df

df = pd.DataFrame(output_data_list)
df.to_parquet(
    output_parquet_file,
    index=False,
    compression="brotli"
)

README history 20 revisions

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.

  1. 2025-03-05Upload train.parquet3c26a055.2 KB
    Loading...
  2. 2025-03-05Upload train.parquetc1a214c5.2 KB
    Loading...
  3. 2025-03-04Upload train.parquetb2813125.2 KB
    Loading...
  4. 2025-03-04Update README.mde2c07925.2 KB
    Loading...
  5. 2025-03-04Create README.mdbe7d1395.2 KB
    Loading...
  6. 2025-03-04Upload train.parquetd1ca7bb0 B
    Loading...
  7. 2025-03-04Upload train.parquet772ebb40 B
    Loading...
  8. 2025-03-04Upload train.parquet5aed6ac0 B
    Loading...
  9. 2025-03-04Upload train.parquet7b31ff10 B
    Loading...
  10. 2025-03-04Upload train.parquet6304c720 B
    Loading...
  11. 2025-03-04Upload train.parquet4d855670 B
    Loading...
  12. 2025-03-04Upload train.parquet763d1190 B
    Loading...
  13. 2025-03-03Upload train.parqueta074c7a0 B
    Loading...
  14. 2025-03-03Upload train.parquetbb98f2f0 B
    Loading...
  15. 2025-03-03Upload train.parquet1dd35420 B
    Loading...
  16. 2025-03-03Upload train.parquetfd938240 B
    Loading...
  17. 2025-03-03Upload train.parquetb0a979c0 B
    Loading...
  18. 2025-03-03Upload train.parquetcf51a950 B
    Loading...
  19. 2025-03-03Upload train.parquet7d5b3fd0 B
    Loading...
  20. 2025-03-03Upload train.parquetc0eb83f0 B
    Loading...

Used by abliterated models none yet

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.

Community discussions 1 thread · 1 open · 1 comments

Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, license clarifications. Click any thread to expand and read the full conversation inline. Newest first.

  1. 2025-03-05[bot] Conversion to Parquetopen1 💬#1
    Loading...

Related datasets same stage · fine-tune

Read further

Repository

Download the dataset

0

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("PJMixers-Dev/allura-org_gryphe-sonnet-3.5-charcards-names-added-r1")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="PJMixers-Dev/allura-org_gryphe-sonnet-3.5-charcards-names-added-r1", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/PJMixers-Dev/allura-org_gryphe-sonnet-3.5-charcards-names-added-r1
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration