[index-tts]请求在 huggingface 上提供 GPT2 模型和分词器

2025-10-30 569 views
3

可能需要以下格式,以便在 vllm 或 sglang 中加载 index-tts ~

(1)GPT2 分词器:

tokenizer.json 
tokenizer_config.json
vocab.json
merges.txt
special_tokens_map.json 

(2)GPT2 模型:

config.json
model.safetensors

可参考 MegaTTS3 提供的 g2p 模型列表: https://huggingface.co/ByteDance/MegaTTS3/tree/main/g2p

回答

4

能给一个pr么,我们是提供了sentencepiece 分词模型,因资源有限,如何适配到GPT2 希望好心人能提供些快速支持。

0

@index-tts 测试 sglang 加载失败。 前提需要把 checkpoints/gpt.pth 转换成 sglang 支持的标准 GPT2LMHeadModel 才行。 gpt2似乎修改了内部结构(wte和位置emb部分) 在此,无能为力~

ValueError: Model architectures are not supported for now.

 Supported architectures: dict_keys(['BaichuanForCausalLM', 'BertModel', 'Contriever', 'ChatGLMModel', 'CLIPModel', 
'CohereForCausalLM', 'Cohere2ForCausalLM', 'DbrxForCausalLM', 'DeepseekForCausalLM', 'MultiModalityCausalLM', 
'DeepseekV3ForCausalLMNextN', 'DeepseekV2ForCausalLM', 'DeepseekV3ForCausalLM', 'DeepseekVL2ForCausalLM', 
'ExaoneForCausalLM', 'GemmaForCausalLM', 'Gemma2ForCausalLM', 'Gemma2ForSequenceClassification', 'Gemma3ForCausalLM', 
'Gemma3ForConditionalGeneration', 'GPT2LMHeadModel', 'GPTBigCodeForCausalLM', 'GraniteForCausalLM', 
'InternLM2ForCausalLM', 'InternLM2ForRewardModel', 'LlamaForCausalLM', 'Phi3ForCausalLM', 'InternLM3ForCausalLM', 
'Llama4ForCausalLM', 'LlamaForClassification', 'LlamaForCausalLMEagle', 'LlamaForCausalLMEagle3', 'LlamaEmbeddingModel', 
'MistralModel', 'LlamaForSequenceClassification', 'LlamaForSequenceClassificationWithNormal_Weights', 'LlavaLlamaForCausalLM', 
'LlavaQwenForCausalLM', 'LlavaMistralForCausalLM', 'LlavaVidForCausalLM', 'MiniCPMForCausalLM', 'MiniCPM3ForCausalLM',
 'MiniCPMO', 'MiniCPMV', 'MistralForCausalLM', 'MixtralForCausalLM', 'QuantMixtralForCausalLM', 
'MllamaForConditionalGeneration', 'Llama4ForConditionalGeneration', 'OlmoForCausalLM', 'Olmo2ForCausalLM', 
'OlmoeForCausalLM', 'Phi3SmallForCausalLM', 'QWenLMHeadModel', 'Qwen2ForCausalLM', 
'Qwen2_5_VLForConditionalGeneration', 'Qwen2ForSequenceClassification', 'Qwen2ForCausalLMEagle', 'Qwen2MoeForCausalLM',
 'Qwen2ForRewardModel', 'Qwen2VLForConditionalGeneration', 'Qwen3ForCausalLM', 'Qwen3MoeForCausalLM', 
'StableLmForCausalLM', 'TorchNativeLlamaForCausalLM', 'TorchNativePhi3ForCausalLM', 'XverseForCausalLM', 
'XverseMoeForCausalLM', 'YiVLForCausalLM'])