Instructions to use Gem1832/monkey_06 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gem1832/monkey_06 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="Gem1832/monkey_06")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("Gem1832/monkey_06", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse filesFiles changed (16)
- .gitattributes+1
- README.mdAdded+24
- chute_config.ymlAdded+27
- config.jsonAdded+163
- generation_config.jsonAdded+12
- merges.txtAdded
- miner.pyAdded+160
- model.safetensorsAdded+3
- preprocessor_config.jsonAdded+6
- speech_tokenizer/config.jsonAdded+94
- speech_tokenizer/configuration.jsonAdded+1
- speech_tokenizer/model.safetensorsAdded+3
- speech_tokenizer/preprocessor_config.jsonAdded+10
- tokenizer_config.jsonAdded+318
- vocab.jsonAdded
- vocence_config.yamlAdded+20
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324---license: cc-by-nc-sa-4.0base_model: Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesignpipeline_tag: text-to-speechlibrary_name: transformerslanguage: - entags: - tts - qwen3-tts - vocence---
# vocence_cool_miner
Prompt-driven English TTS on Qwen3-TTS-12Hz-1.7B-VoiceDesign.
```pythonfrom qwen_tts import Qwen3TTSModelm = Qwen3TTSModel.from_pretrained("forgery989/vocence_cool_miner")wavs, sr = m.generate_voice_design(text="Hi.", instruct="Friendly voice.", language="english")```
CC BY-NC-SA 4.0.123456789101112131415161718192021222324252627# Image + node + Chute for Vocence deploy. Required in the HF repo at build time.# Keep deps minimal — anything imported by miner.py must not be in the validator's# banned list (requests/urllib/httpx/aiohttp/socket/huggingface_hub/importlib/torch.hub).# huggingface_hub is intentionally NOT installed so an accidental future import# in miner.py fails fast at runtime instead of silently being available.
Image: from_base: parachutes/base-python:3.12.9 run_command: - pip install torch torchaudio transformers==4.57.3 accelerate pyyaml soundfile - pip install -U qwen-tts set_workdir: /app
NodeSelector: gpu_count: 1 min_vram_gb_per_gpu: 24 include: ["pro_6000"] exclude: []
Chute: tagline: vocence qwen3-tts miner readme: vocence chute serving qwen3-tts via miner.py (weights pinned in repo) shutdown_after_seconds: 86400 concurrency: 1 max_instances: 1 scaling_threshold: 0.5 tee: true123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163{ "architectures": [ "Qwen3TTSForConditionalGeneration" ], "assistant_token_id": 77091, "im_end_token_id": 151645, "im_start_token_id": 151644, "tts_bos_token_id": 151672, "tts_eos_token_id": 151673, "tts_pad_token_id": 151671, "model_type": "qwen3_tts", "tokenizer_type": "qwen3_tts_tokenizer_12hz", "tts_model_size": "1b7", "tts_model_type": "voice_design", "talker_config": { "attention_bias": false, "attention_dropout": 0, "code_predictor_config": { "_name_or_path": "", "add_cross_attention": false, "architectures": null, "attention_bias": false, "attention_dropout": 0, "bad_words_ids": null, "begin_suppress_tokens": null, "bos_token_id": null, "chunk_size_feed_forward": 0, "cross_attention_hidden_size": null, "decoder_start_token_id": null, "diversity_penalty": 0.0, "do_sample": false, "early_stopping": false, "encoder_no_repeat_ngram_size": 0, "eos_token_id": null, "exponential_decay_length_penalty": null, "finetuning_task": null, "forced_bos_token_id": null, "forced_eos_token_id": null, "head_dim": 128, "hidden_act": "silu", "hidden_size": 1024, "id2label": { "0": "LABEL_0", "1": "LABEL_1" }, "initializer_range": 0.02, "intermediate_size": 3072, "is_decoder": false, "is_encoder_decoder": false, "label2id": { "LABEL_0": 0, "LABEL_1": 1 }, "layer_types": [ "full_attention", "full_attention", "full_attention", "full_attention", "full_attention" ], "length_penalty": 1.0, "max_length": 20, "max_position_embeddings": 65536, "max_window_layers": 28, "min_length": 0, "model_type": "qwen3_tts_talker_code_predictor", "no_repeat_ngram_size": 0, "num_attention_heads": 16, "num_beam_groups": 1, "num_beams": 1, "num_code_groups": 16, "num_hidden_layers": 5, "num_key_value_heads": 8, "num_return_sequences": 1, "output_attentions": false, "output_hidden_states": false, "output_scores": false, "pad_token_id": null, "prefix": null, "problem_type": null, "pruned_heads": {}, "remove_invalid_values": false, "repetition_penalty": 1.0, "return_dict": true, "return_dict_in_generate": false, "rms_norm_eps": 1e-06, "rope_scaling": null, "rope_theta": 1000000, "sep_token_id": null, "sliding_window": null, "suppress_tokens": null, "task_specific_params": null, "temperature": 1.0, "tf_legacy_loss": false, "tie_encoder_decoder": false, "tie_word_embeddings": false, "tokenizer_class": null, "top_k": 50, "top_p": 1.0, "dtype": null, "torchscript": false, "typical_p": 1.0, "use_bfloat16": false, "use_cache": true, "use_sliding_window": false, "vocab_size": 2048 }, "codec_bos_id": 2149, "codec_eos_token_id": 2150, "codec_think_id": 2154, "codec_language_id": { "chinese": 2055, "english": 2050, "german": 2053, "italian": 2070, "portuguese": 2071, "spanish": 2054, "japanese": 2058, "korean": 2064, "french": 2061, "russian": 2069 }, "codec_nothink_id": 2155, "codec_pad_id": 2148, "codec_think_bos_id": 2156, "codec_think_eos_id": 2157, "spk_id": { }, "spk_is_dialect": { }, "head_dim": 128, "hidden_act": "silu", "hidden_size": 2048, "initializer_range": 0.02, "intermediate_size": 6144, "max_position_embeddings": 32768, "model_type": "qwen3_tts_talker", "num_attention_heads": 16, "num_code_groups": 16, "num_hidden_layers": 28, "num_key_value_heads": 8, "position_id_per_seconds": 13, "rms_norm_eps": 1e-06, "rope_scaling": { "interleaved": true, "mrope_section": [ 24, 20, 20 ], "rope_type": "default", "type": "default" }, "rope_theta": 1000000, "sliding_window": null, "text_hidden_size": 2048, "text_vocab_size": 151936, "use_cache": true, "use_sliding_window": false, "vocab_size": 3072 }, "transformers_version": "4.57.3"}123456789101112{ "do_sample": true, "repetition_penalty": 1.05, "temperature": 0.9, "top_p": 1.0, "top_k": 50, "subtalker_dosample": true, "subtalker_temperature": 0.9, "subtalker_top_p": 1.0, "subtalker_top_k": 50, "max_new_tokens": 8192}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160"""Vocence TTS engine: Qwen3 12Hz checkpoint in the HF repo snapshot.
The chute snapshot is the only weight source: nothing is pulled from an externalmodel id at inference time. Optional vocence_config.yaml tweaks device, dtype,attention, and language defaults.
Model load: Miner.__init__ -> _instantiate_qwen() -> Qwen3TTSModel.from_pretrained(repo_path).
Contract (Vocence): Miner(path_hf_repo: Path) warmup() -> None generate_wav(instruction: str, text: str) -> tuple[np.ndarray, int]"""from __future__ import annotations
import threadingfrom pathlib import Pathfrom typing import Any, Mapping
import numpy as np
_CONFIG_NAME = "config.json"_VOCENCE_YAML = "vocence_config.yaml"
def _merge_vocence_yaml(repo: Path) -> dict[str, Any]: path = repo / _VOCENCE_YAML if not path.is_file(): return {} from yaml import safe_load
with path.open("r", encoding="utf-8") as fh: data = safe_load(fh) return data if isinstance(data, Mapping) else {}
def _ensure_repo_checkpoint(repo: Path) -> Path: repo = repo.resolve() marker = repo / _CONFIG_NAME if not marker.is_file(): raise FileNotFoundError( f"Model snapshot incomplete: {marker} missing. " "Host the full Qwen3-TTS weights (checkpoint + tokenizers) in this repository." ) return repo
def _resolve_compute_device(prefer_cuda: bool) -> str: import torch
if prefer_cuda and torch.cuda.is_available(): return "cuda:0" return "cpu"
def _resolve_torch_dtype(torch, prefer_bf16: bool): if prefer_bf16 and torch.cuda.is_available(): return torch.bfloat16 return torch.float32
def _instantiate_qwen(checkpoint_dir: str, device_map: str, torch_dtype, use_flash2: bool): """Load Qwen3TTSModel weights from the local repo directory (HF snapshot path).""" from qwen_tts import Qwen3TTSModel
attn = "flash_attention_2" if use_flash2 else "sdpa" common = dict( pretrained_model_name_or_path=checkpoint_dir, device_map=device_map, dtype=torch_dtype, attn_implementation=attn, ) try: return Qwen3TTSModel.from_pretrained(**common) except Exception: common["attn_implementation"] = "sdpa" return Qwen3TTSModel.from_pretrained(**common)
def _to_mono_f32(segment: np.ndarray) -> np.ndarray: x = np.asarray(segment, dtype=np.float32) if x.ndim > 1: x = x.mean(axis=1) return x
class Miner: """ Loads the checkpoint from the Hugging Face repo directory Chutes downloaded. Synthesis uses natural-language instruction + text (qwen-tts API). """
def __init__(self, path_hf_repo: Path) -> None: self._root = _ensure_repo_checkpoint(Path(path_hf_repo)) self._cfg = _merge_vocence_yaml(self._root) rt = self._cfg.get("runtime") or {} gen = self._cfg.get("generation") or {} lim = self._cfg.get("limits") or {}
self._language = str(lim.get("default_language") or rt.get("default_language", "English")) self._output_sr = int(gen.get("sample_rate", 24000)) self._cap_instruction = int(lim.get("max_instruction_chars", 600)) self._cap_text = int(lim.get("max_text_chars", 2000))
prefer_cuda = str(rt.get("device_preference", "cuda")).lower() == "cuda" want_bf16 = str(rt.get("dtype", "bfloat16")).lower() == "bfloat16" flash = bool(rt.get("use_flash_attention_2", False))
import torch
device_map = _resolve_compute_device(prefer_cuda) torch_dtype = _resolve_torch_dtype(torch, want_bf16) ckpt = str(self._root)
self._tts = _instantiate_qwen(ckpt, device_map, torch_dtype, flash) # Qwen3TTSModel is a thin wrapper, not nn.Module — no .eval() print("Qwen3-TTS checkpoint ready (loaded from repo snapshot).")
def __repr__(self) -> str: return "Miner(qwen3-tts-local, local_snapshot=True)"
def warmup(self) -> None: """Force one cheap synthesis on a background thread (startup SLAs).""" status: dict[str, object] = {"done": False, "error": None}
def _once() -> None: try: self.generate_wav( instruction="Clear, neutral delivery.", text="Warmup.", ) status["done"] = True except Exception as exc: # noqa: BLE001 — surface to host status["error"] = str(exc)
worker = threading.Thread(target=_once, daemon=True) worker.start() worker.join(timeout=180.0) if not status["done"]: raise RuntimeError(status["error"] or "warmup exceeded 180s")
def generate_wav(self, instruction: str, text: str) -> tuple[np.ndarray, int]: if self._cap_instruction > 0: instruction = instruction[: self._cap_instruction] if self._cap_text > 0: text = text[: self._cap_text]
# Upstream qwen-tts method name (instruct + text -> waveform). waves, sr = self._tts.generate_voice_design( text=text, language=self._language, instruct=instruction, ) if not waves: raise ValueError("TTS generation returned no audio") first = waves[0] if first is None: raise ValueError("TTS generation returned empty channel") return _to_mono_f32(first), int(sr)123version https://git-lfs.github.com/spec/v1oid sha256:ff4ca4b1375958ace180609af889ca8d14c64de7eb96a406acb7146a7a374cbesize 3833402552123456{ "padding_side": "left", "padding_value": 0.0, "processor_class": "Qwen3TTSProcessor", "return_attention_mask": true}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394{ "architectures": [ "Qwen3TTSTokenizerV2Model" ], "model_type": "qwen3_tts_tokenizer_12hz", "encoder_valid_num_quantizers": 16, "input_sample_rate": 24000, "output_sample_rate": 24000, "decode_upsample_rate": 1920, "encode_downsample_rate": 1920, "decoder_config": { "attention_bias": false, "attention_dropout": 0.0, "latent_dim": 1024, "codebook_dim": 512, "codebook_size": 2048, "decoder_dim": 1536, "hidden_act": "silu", "hidden_size": 512, "intermediate_size": 1024, "layer_scale_initial_scale": 0.01, "max_position_embeddings": 8000, "head_dim": 64, "num_attention_heads": 16, "num_hidden_layers": 8, "num_key_value_heads": 16, "num_quantizers": 16, "num_semantic_quantizers": 1, "rms_norm_eps": 1e-05, "rope_theta": 10000, "semantic_codebook_size": 4096, "sliding_window": 72, "upsample_rates": [ 8, 5, 4, 3 ], "upsampling_ratios": [ 2, 2 ], "vector_quantization_hidden_dimension": 512 }, "encoder_config": { "_frame_rate": 12.5, "attention_bias": false, "attention_dropout": 0.0, "audio_channels": 1, "codebook_dim": 256, "codebook_size": 2048, "compress": 2, "dilation_growth_rate": 2, "dtype": "float32", "head_dim": 64, "hidden_act": "gelu", "hidden_size": 512, "initializer_range": 0.02, "intermediate_size": 2048, "kernel_size": 7, "last_kernel_size": 3, "layer_scale_initial_scale": 0.01, "max_position_embeddings": 8000, "norm_eps": 1e-05, "normalize": false, "num_attention_heads": 8, "num_filters": 64, "num_hidden_layers": 8, "num_key_value_heads": 8, "num_quantizers": 32, "num_residual_layers": 1, "num_semantic_quantizers": 1, "pad_mode": "constant", "residual_kernel_size": 3, "rope_theta": 10000.0, "sampling_rate": 24000, "sliding_window": 250, "transformers_version": "4.57.0.dev0", "trim_right_ratio": 1.0, "upsample_groups": 512, "upsampling_ratios": [ 8, 6, 5, 4 ], "use_cache": false, "use_causal_conv": true, "use_conv_shortcut": false, "use_streaming": false, "vector_quantization_hidden_dimension": 256 }, "transformers_version": "4.57.3"}1{"framework": "pytorch", "task": "feature-extraction", "allow_remote": true}123version https://git-lfs.github.com/spec/v1oid sha256:3f1ba55a1bb6328b40da379ffa85705fe9d9e9bdf362c474d706fa5d039ee0fcsize 68229312412345678910{ "chunk_length_s": null, "feature_extractor_type": "EncodecFeatureExtractor", "feature_size": 1, "overlap": null, "padding_side": "right", "padding_value": 0.0, "return_attention_mask": true, "sampling_rate": 24000}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318{ "add_bos_token": false, "add_prefix_space": false, "added_tokens_decoder": { "151643": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151644": { "content": "<|im_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151645": { "content": "<|im_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151646": { "content": "<|object_ref_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151647": { "content": "<|object_ref_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151648": { "content": "<|box_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151649": { "content": "<|box_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151650": { "content": "<|quad_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151651": { "content": "<|quad_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151652": { "content": "<|vision_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151653": { "content": "<|vision_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151654": { "content": "<|vision_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151655": { "content": "<|image_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151656": { "content": "<|video_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151657": { "content": "<tool_call>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151658": { "content": "</tool_call>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151659": { "content": "<|fim_prefix|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151660": { "content": "<|fim_middle|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151661": { "content": "<|fim_suffix|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151662": { "content": "<|fim_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151663": { "content": "<|repo_name|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151664": { "content": "<|file_sep|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151665": { "content": "<tool_response>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151666": { "content": "</tool_response>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151667": { "content": "<think>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151668": { "content": "</think>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "151669": { "content": "<|audio_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151670": { "content": "<|audio_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151671": { "content": "<tts_pad>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151672": { "content": "<tts_text_bos>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151673": { "content": "<tts_text_eod>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151674": { "content": "<tts_text_bos_single>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "151675": { "content": "<|audio_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ "<|im_start|>", "<|im_end|>", "<|object_ref_start|>", "<|object_ref_end|>", "<|box_start|>", "<|box_end|>", "<|quad_start|>", "<|quad_end|>", "<|vision_start|>", "<|vision_end|>", "<|vision_pad|>", "<|image_pad|>", "<|video_pad|>", "<|audio_start|>", "<|audio_end|>", "<tts_pad>", "<tts_text_bos>", "<tts_text_bos_single>", "<|audio_pad|>" ], "audio_bos_token": "<|audio_start|>", "audio_eos_token": "<|audio_end|>", "audio_token": "<|audio_pad|>", "bos_token": null, "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "errors": "replace", "extra_special_tokens": { "audio_bos_token": "<|audio_start|>", "audio_eos_token": "<|audio_end|>", "audio_token": "<|audio_pad|>", "image_token": "<|image_pad|>", "video_token": "<|video_pad|>", "vision_bos_token": "<|vision_start|>", "vision_eos_token": "<|vision_end|>" }, "fix_mistral_regex": true, "image_token": "<|image_pad|>", "model_max_length": 131072, "pad_token": "<|endoftext|>", "processor_class": "Qwen3TTSProcessor", "split_special_tokens": false, "tokenizer_class": "Qwen2Tokenizer", "unk_token": null, "video_token": "<|video_pad|>", "vision_bos_token": "<|vision_start|>", "vision_eos_token": "<|vision_end|>"}1234567891011121314151617181920model_name: "Gem1832/monkey_06"
runtime: adapter: "qwen3-tts" device_preference: "cuda" dtype: "bfloat16" use_flash_attention_2: false default_language: "English"
generation: sample_rate: 24000 max_seconds: 20 guidance_scale: 1.0
io: output_format: "wav"
limits: max_text_chars: 2000 max_instruction_chars: 600.gitattributes+1
README.mdAdded+24
chute_config.ymlAdded+27
config.jsonAdded+163
generation_config.jsonAdded+12
merges.txtAdded
miner.pyAdded+160
model.safetensorsAdded+3
preprocessor_config.jsonAdded+6
speech_tokenizer/config.jsonAdded+94
speech_tokenizer/configuration.jsonAdded+1
speech_tokenizer/model.safetensorsAdded+3
speech_tokenizer/preprocessor_config.jsonAdded+10
tokenizer_config.jsonAdded+318
vocab.jsonAdded
vocence_config.yamlAdded+20