Cannot Run Model in Hugging Face Spaces: AutoProcessor/Processor Not Found
I am trying to deploy moonshotai/Kimi-Audio-7B-Instruct in a Hugging Face Space (Gradio app). The model loads with trust_remote_code=True for the model weights, but processing fails with the following error:
ValueError: Unrecognized processing class in moonshotai/Kimi-Audio-7B-Instruct. Can't instantiate a processor, a tokenizer, an image processor or a feature extractor for this model. Make sure the repository contains the files of at least one of those processing classes.
Attempts to load the processor via its custom class (as in your demo) using this fallback:
from moonshot_kimia.processing_kimiaudio import KimiaudioProcessor
processor = KimiaudioProcessor.from_pretrained(model_id, trust_remote_code=True)
also fails in Spaces with:
ModuleNotFoundError: No module named 'moonshot_kimia'
Summary:
The model works with trust_remote_code=True for the model weights.
The processor cannot be loaded by AutoProcessor.
The direct import of the processor class fails in the Hugging Face Spaces environment—likely because the processor is not registered or not available as an auto-loaded module.
Could you please:
Register your custom processor class so it can be properly loaded via AutoProcessor.from_pretrained?
Or provide guidance/a code example for loading the processor in a Hugging Face Space or other remote, sandboxed environment?
This would make Spaces and cloud deployment possible. Thank you in advance!