nexaai 1.0.4rc10__py3-none-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nexaai might be problematic. Click here for more details.
- nexaai/__init__.py +71 -0
- nexaai/_version.py +4 -0
- nexaai/asr.py +60 -0
- nexaai/asr_impl/__init__.py +0 -0
- nexaai/asr_impl/mlx_asr_impl.py +91 -0
- nexaai/asr_impl/pybind_asr_impl.py +43 -0
- nexaai/base.py +39 -0
- nexaai/binds/__init__.py +3 -0
- nexaai/binds/common_bind.cpython-310-darwin.so +0 -0
- nexaai/binds/embedder_bind.cpython-310-darwin.so +0 -0
- nexaai/binds/libnexa_bridge.dylib +0 -0
- nexaai/binds/llm_bind.cpython-310-darwin.so +0 -0
- nexaai/binds/nexa_llama_cpp/libggml-base.dylib +0 -0
- nexaai/binds/nexa_llama_cpp/libggml-cpu.so +0 -0
- nexaai/binds/nexa_llama_cpp/libggml-metal.so +0 -0
- nexaai/binds/nexa_llama_cpp/libggml.dylib +0 -0
- nexaai/binds/nexa_llama_cpp/libllama.dylib +0 -0
- nexaai/binds/nexa_llama_cpp/libmtmd.dylib +0 -0
- nexaai/binds/nexa_llama_cpp/libnexa_plugin.dylib +0 -0
- nexaai/binds/nexa_mlx/libnexa_plugin.dylib +0 -0
- nexaai/binds/nexa_mlx/py-lib/ml.py +842 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/__init__.py +5 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/bigvgan/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/bigvgan/activation.py +51 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/bigvgan/amp.py +96 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/bigvgan/bigvgan.py +149 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/bigvgan/conv.py +114 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/bigvgan/resample.py +177 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/descript/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/descript/base.py +228 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/descript/dac.py +285 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/descript/nn/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/descript/nn/layers.py +129 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/descript/nn/quantize.py +149 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/encodec/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/encodec/encodec.py +777 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/mimi/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/mimi/mimi.py +286 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/mimi/modules/__init__.py +20 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/mimi/modules/conv.py +398 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/mimi/modules/kv_cache.py +199 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/mimi/modules/quantization.py +179 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/mimi/modules/seanet.py +314 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/mimi/modules/transformer.py +256 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/s3/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/s3/model.py +260 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/s3/model_v2.py +383 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/s3/utils.py +122 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/snac/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/snac/attention.py +97 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/snac/layers.py +306 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/snac/snac.py +154 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/snac/vq.py +135 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/vocos/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/vocos/mel.py +33 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/models/vocos/vocos.py +359 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/tests/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/tests/test_bigvgan.py +54 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/tests/test_descript.py +109 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/tests/test_encodec.py +58 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/tests/test_mimi.py +22 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/tests/test_s3.py +25 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/tests/test_snac.py +40 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/codec/tests/test_vocos.py +93 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/server.py +525 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/sts/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/sts/tests/test_voice_pipeline.py +156 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/sts/voice_pipeline.py +327 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/generate.py +174 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/alignment.py +248 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/attention.py +187 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/audio.py +76 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/conformer.py +331 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/ctc.py +34 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/parakeet.py +604 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/rnnt.py +157 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/parakeet/tokenizer.py +2 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/wav2vec/feature_extractor.py +757 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/wav2vec/wav2vec.py +738 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/whisper/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/whisper/audio.py +82 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/whisper/decoding.py +742 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/whisper/timing.py +329 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/whisper/tokenizer.py +398 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/whisper/whisper.py +862 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/models/whisper/writers.py +268 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/tests/test_models.py +381 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/stt/utils.py +195 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/audio_player.py +120 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/convert.py +71 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/generate.py +449 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/bark/__init__.py +4 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/bark/bark.py +528 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/bark/isftnet.py +12 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/bark/pipeline.py +442 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/base.py +84 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/dia/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/dia/audio.py +287 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/dia/config.py +256 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/dia/dia.py +592 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/dia/layers.py +870 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/__init__.py +3 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/attention.py +180 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/bigvgan.py +124 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/conformer.py +247 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/ecapa_tdnn/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/ecapa_tdnn/asp.py +59 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/ecapa_tdnn/ecapa_tdnn.py +91 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/ecapa_tdnn/se_res2net.py +132 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/ecapa_tdnn/tdnn.py +42 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/gpt2.py +38 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/indextts.py +412 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/mel.py +37 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/normalize.py +294 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/indextts/perceiver.py +62 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/interpolate.py +108 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/kokoro/__init__.py +4 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/kokoro/istftnet.py +979 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/kokoro/kokoro.py +331 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/kokoro/modules.py +659 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/kokoro/pipeline.py +453 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/kokoro/voice.py +113 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/llama/__init__.py +3 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/llama/llama.py +324 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/outetts/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/outetts/audio_processor.py +351 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/outetts/dac_interface.py +162 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/outetts/outetts.py +255 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/outetts/prompt_processor.py +181 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/outetts/tokens.py +36 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/sesame/__init__.py +3 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/sesame/attention.py +195 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/sesame/sesame.py +633 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/sesame/watermarking.py +105 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/audio_tokenizer.py +138 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/bicodec.py +269 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/blocks/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/blocks/sampler.py +111 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/encoder_decoder/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/encoder_decoder/feat_decoder.py +120 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/encoder_decoder/feat_encoder.py +136 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/encoder_decoder/wave_generator.py +113 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/finite_scalar_quantization.py +238 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/residual.py +209 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/residual_fsq.py +309 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/speaker/__init__.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/speaker/ecapa_tdnn.py +283 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/speaker/perceiver_encoder.py +326 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/speaker/pooling_layers.py +297 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/modules/speaker/speaker_encoder.py +155 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/spark.py +382 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/utils/audio.py +220 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/utils/file.py +221 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/models/spark/utils/token_parser.py +181 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/tests/__init__.py +0 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/tests/test_base.py +66 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/tests/test_convert.py +173 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/tests/test_interpolate.py +88 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/tests/test_models.py +974 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/tts/utils.py +337 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/utils.py +237 -0
- nexaai/binds/nexa_mlx/py-lib/mlx_audio/version.py +1 -0
- nexaai/binds/nexa_mlx/py-lib/profiling.py +239 -0
- nexaai/common.py +61 -0
- nexaai/cv.py +87 -0
- nexaai/cv_impl/__init__.py +0 -0
- nexaai/cv_impl/mlx_cv_impl.py +88 -0
- nexaai/cv_impl/pybind_cv_impl.py +31 -0
- nexaai/embedder.py +68 -0
- nexaai/embedder_impl/__init__.py +0 -0
- nexaai/embedder_impl/mlx_embedder_impl.py +114 -0
- nexaai/embedder_impl/pybind_embedder_impl.py +91 -0
- nexaai/image_gen.py +136 -0
- nexaai/image_gen_impl/__init__.py +0 -0
- nexaai/image_gen_impl/mlx_image_gen_impl.py +291 -0
- nexaai/image_gen_impl/pybind_image_gen_impl.py +84 -0
- nexaai/llm.py +89 -0
- nexaai/llm_impl/__init__.py +0 -0
- nexaai/llm_impl/mlx_llm_impl.py +249 -0
- nexaai/llm_impl/pybind_llm_impl.py +207 -0
- nexaai/mlx_backend/asr/__init__.py +12 -0
- nexaai/mlx_backend/asr/interface.py +122 -0
- nexaai/mlx_backend/common/__init__.py +0 -0
- nexaai/mlx_backend/common/utils.py +25 -0
- nexaai/mlx_backend/cv/__init__.py +0 -0
- nexaai/mlx_backend/cv/generate.py +195 -0
- nexaai/mlx_backend/cv/interface.py +151 -0
- nexaai/mlx_backend/cv/main.py +81 -0
- nexaai/mlx_backend/cv/modeling/pp_ocr_v4.py +1736 -0
- nexaai/mlx_backend/embedding/__init__.py +0 -0
- nexaai/mlx_backend/embedding/generate.py +130 -0
- nexaai/mlx_backend/embedding/interface.py +312 -0
- nexaai/mlx_backend/embedding/main.py +82 -0
- nexaai/mlx_backend/embedding/modeling/__init__.py +0 -0
- nexaai/mlx_backend/embedding/modeling/nexa_jina_v2.py +399 -0
- nexaai/mlx_backend/llm/__init__.py +0 -0
- nexaai/mlx_backend/llm/generate.py +149 -0
- nexaai/mlx_backend/llm/interface.py +764 -0
- nexaai/mlx_backend/llm/main.py +68 -0
- nexaai/mlx_backend/ml.py +842 -0
- nexaai/mlx_backend/mlx_audio/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/codec/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/__init__.py +5 -0
- nexaai/mlx_backend/mlx_audio/codec/models/bigvgan/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/bigvgan/activation.py +51 -0
- nexaai/mlx_backend/mlx_audio/codec/models/bigvgan/amp.py +96 -0
- nexaai/mlx_backend/mlx_audio/codec/models/bigvgan/bigvgan.py +149 -0
- nexaai/mlx_backend/mlx_audio/codec/models/bigvgan/conv.py +114 -0
- nexaai/mlx_backend/mlx_audio/codec/models/bigvgan/resample.py +177 -0
- nexaai/mlx_backend/mlx_audio/codec/models/descript/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/descript/base.py +228 -0
- nexaai/mlx_backend/mlx_audio/codec/models/descript/dac.py +285 -0
- nexaai/mlx_backend/mlx_audio/codec/models/descript/nn/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/descript/nn/layers.py +129 -0
- nexaai/mlx_backend/mlx_audio/codec/models/descript/nn/quantize.py +149 -0
- nexaai/mlx_backend/mlx_audio/codec/models/encodec/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/encodec/encodec.py +777 -0
- nexaai/mlx_backend/mlx_audio/codec/models/mimi/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/mimi/mimi.py +286 -0
- nexaai/mlx_backend/mlx_audio/codec/models/mimi/modules/__init__.py +20 -0
- nexaai/mlx_backend/mlx_audio/codec/models/mimi/modules/conv.py +398 -0
- nexaai/mlx_backend/mlx_audio/codec/models/mimi/modules/kv_cache.py +199 -0
- nexaai/mlx_backend/mlx_audio/codec/models/mimi/modules/quantization.py +179 -0
- nexaai/mlx_backend/mlx_audio/codec/models/mimi/modules/seanet.py +314 -0
- nexaai/mlx_backend/mlx_audio/codec/models/mimi/modules/transformer.py +256 -0
- nexaai/mlx_backend/mlx_audio/codec/models/s3/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/s3/model.py +260 -0
- nexaai/mlx_backend/mlx_audio/codec/models/s3/model_v2.py +383 -0
- nexaai/mlx_backend/mlx_audio/codec/models/s3/utils.py +122 -0
- nexaai/mlx_backend/mlx_audio/codec/models/snac/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/snac/attention.py +97 -0
- nexaai/mlx_backend/mlx_audio/codec/models/snac/layers.py +306 -0
- nexaai/mlx_backend/mlx_audio/codec/models/snac/snac.py +154 -0
- nexaai/mlx_backend/mlx_audio/codec/models/snac/vq.py +135 -0
- nexaai/mlx_backend/mlx_audio/codec/models/vocos/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/codec/models/vocos/mel.py +33 -0
- nexaai/mlx_backend/mlx_audio/codec/models/vocos/vocos.py +359 -0
- nexaai/mlx_backend/mlx_audio/codec/tests/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/codec/tests/test_bigvgan.py +54 -0
- nexaai/mlx_backend/mlx_audio/codec/tests/test_descript.py +109 -0
- nexaai/mlx_backend/mlx_audio/codec/tests/test_encodec.py +58 -0
- nexaai/mlx_backend/mlx_audio/codec/tests/test_mimi.py +22 -0
- nexaai/mlx_backend/mlx_audio/codec/tests/test_s3.py +25 -0
- nexaai/mlx_backend/mlx_audio/codec/tests/test_snac.py +40 -0
- nexaai/mlx_backend/mlx_audio/codec/tests/test_vocos.py +93 -0
- nexaai/mlx_backend/mlx_audio/server.py +525 -0
- nexaai/mlx_backend/mlx_audio/sts/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/sts/tests/test_voice_pipeline.py +156 -0
- nexaai/mlx_backend/mlx_audio/sts/voice_pipeline.py +327 -0
- nexaai/mlx_backend/mlx_audio/stt/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/stt/generate.py +174 -0
- nexaai/mlx_backend/mlx_audio/stt/models/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/alignment.py +248 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/attention.py +187 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/audio.py +76 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/conformer.py +331 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/ctc.py +34 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/parakeet.py +604 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/rnnt.py +157 -0
- nexaai/mlx_backend/mlx_audio/stt/models/parakeet/tokenizer.py +2 -0
- nexaai/mlx_backend/mlx_audio/stt/models/wav2vec/feature_extractor.py +757 -0
- nexaai/mlx_backend/mlx_audio/stt/models/wav2vec/wav2vec.py +738 -0
- nexaai/mlx_backend/mlx_audio/stt/models/whisper/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/stt/models/whisper/audio.py +82 -0
- nexaai/mlx_backend/mlx_audio/stt/models/whisper/decoding.py +742 -0
- nexaai/mlx_backend/mlx_audio/stt/models/whisper/timing.py +329 -0
- nexaai/mlx_backend/mlx_audio/stt/models/whisper/tokenizer.py +398 -0
- nexaai/mlx_backend/mlx_audio/stt/models/whisper/whisper.py +862 -0
- nexaai/mlx_backend/mlx_audio/stt/models/whisper/writers.py +268 -0
- nexaai/mlx_backend/mlx_audio/stt/tests/test_models.py +381 -0
- nexaai/mlx_backend/mlx_audio/stt/utils.py +195 -0
- nexaai/mlx_backend/mlx_audio/tts/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/tts/audio_player.py +120 -0
- nexaai/mlx_backend/mlx_audio/tts/convert.py +71 -0
- nexaai/mlx_backend/mlx_audio/tts/generate.py +449 -0
- nexaai/mlx_backend/mlx_audio/tts/models/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/tts/models/bark/__init__.py +4 -0
- nexaai/mlx_backend/mlx_audio/tts/models/bark/bark.py +528 -0
- nexaai/mlx_backend/mlx_audio/tts/models/bark/isftnet.py +12 -0
- nexaai/mlx_backend/mlx_audio/tts/models/bark/pipeline.py +442 -0
- nexaai/mlx_backend/mlx_audio/tts/models/base.py +84 -0
- nexaai/mlx_backend/mlx_audio/tts/models/dia/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/tts/models/dia/audio.py +287 -0
- nexaai/mlx_backend/mlx_audio/tts/models/dia/config.py +256 -0
- nexaai/mlx_backend/mlx_audio/tts/models/dia/dia.py +592 -0
- nexaai/mlx_backend/mlx_audio/tts/models/dia/layers.py +870 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/__init__.py +3 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/attention.py +180 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/bigvgan.py +124 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/conformer.py +247 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/ecapa_tdnn/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/ecapa_tdnn/asp.py +59 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/ecapa_tdnn/ecapa_tdnn.py +91 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/ecapa_tdnn/se_res2net.py +132 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/ecapa_tdnn/tdnn.py +42 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/gpt2.py +38 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/indextts.py +412 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/mel.py +37 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/normalize.py +294 -0
- nexaai/mlx_backend/mlx_audio/tts/models/indextts/perceiver.py +62 -0
- nexaai/mlx_backend/mlx_audio/tts/models/interpolate.py +108 -0
- nexaai/mlx_backend/mlx_audio/tts/models/kokoro/__init__.py +4 -0
- nexaai/mlx_backend/mlx_audio/tts/models/kokoro/istftnet.py +979 -0
- nexaai/mlx_backend/mlx_audio/tts/models/kokoro/kokoro.py +331 -0
- nexaai/mlx_backend/mlx_audio/tts/models/kokoro/modules.py +659 -0
- nexaai/mlx_backend/mlx_audio/tts/models/kokoro/pipeline.py +453 -0
- nexaai/mlx_backend/mlx_audio/tts/models/kokoro/voice.py +113 -0
- nexaai/mlx_backend/mlx_audio/tts/models/llama/__init__.py +3 -0
- nexaai/mlx_backend/mlx_audio/tts/models/llama/llama.py +324 -0
- nexaai/mlx_backend/mlx_audio/tts/models/outetts/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/tts/models/outetts/audio_processor.py +351 -0
- nexaai/mlx_backend/mlx_audio/tts/models/outetts/dac_interface.py +162 -0
- nexaai/mlx_backend/mlx_audio/tts/models/outetts/default_speaker.json +461 -0
- nexaai/mlx_backend/mlx_audio/tts/models/outetts/outetts.py +255 -0
- nexaai/mlx_backend/mlx_audio/tts/models/outetts/prompt_processor.py +181 -0
- nexaai/mlx_backend/mlx_audio/tts/models/outetts/tokens.py +36 -0
- nexaai/mlx_backend/mlx_audio/tts/models/sesame/__init__.py +3 -0
- nexaai/mlx_backend/mlx_audio/tts/models/sesame/attention.py +195 -0
- nexaai/mlx_backend/mlx_audio/tts/models/sesame/sesame.py +633 -0
- nexaai/mlx_backend/mlx_audio/tts/models/sesame/watermarking.py +105 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/audio_tokenizer.py +138 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/bicodec.py +269 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/blocks/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/blocks/sampler.py +111 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/encoder_decoder/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/encoder_decoder/feat_decoder.py +120 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/encoder_decoder/feat_encoder.py +136 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/encoder_decoder/wave_generator.py +113 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/finite_scalar_quantization.py +238 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/residual.py +209 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/residual_fsq.py +309 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/speaker/__init__.py +1 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/speaker/ecapa_tdnn.py +283 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/speaker/perceiver_encoder.py +326 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/speaker/pooling_layers.py +297 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/modules/speaker/speaker_encoder.py +155 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/spark.py +382 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/utils/audio.py +220 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/utils/file.py +221 -0
- nexaai/mlx_backend/mlx_audio/tts/models/spark/utils/token_parser.py +181 -0
- nexaai/mlx_backend/mlx_audio/tts/tests/__init__.py +0 -0
- nexaai/mlx_backend/mlx_audio/tts/tests/test_base.py +66 -0
- nexaai/mlx_backend/mlx_audio/tts/tests/test_convert.py +173 -0
- nexaai/mlx_backend/mlx_audio/tts/tests/test_interpolate.py +88 -0
- nexaai/mlx_backend/mlx_audio/tts/tests/test_models.py +974 -0
- nexaai/mlx_backend/mlx_audio/tts/utils.py +337 -0
- nexaai/mlx_backend/mlx_audio/utils.py +237 -0
- nexaai/mlx_backend/mlx_audio/version.py +1 -0
- nexaai/mlx_backend/profiling.py +239 -0
- nexaai/mlx_backend/rerank/__init__.py +0 -0
- nexaai/mlx_backend/rerank/generate.py +174 -0
- nexaai/mlx_backend/rerank/interface.py +287 -0
- nexaai/mlx_backend/rerank/main.py +127 -0
- nexaai/mlx_backend/rerank/modeling/__init__.py +0 -0
- nexaai/mlx_backend/rerank/modeling/nexa_jina_rerank.py +330 -0
- nexaai/mlx_backend/sd/__init__.py +1 -0
- nexaai/mlx_backend/sd/interface.py +362 -0
- nexaai/mlx_backend/sd/main.py +286 -0
- nexaai/mlx_backend/sd/modeling/__init__.py +306 -0
- nexaai/mlx_backend/sd/modeling/clip.py +116 -0
- nexaai/mlx_backend/sd/modeling/config.py +65 -0
- nexaai/mlx_backend/sd/modeling/model_io.py +330 -0
- nexaai/mlx_backend/sd/modeling/sampler.py +105 -0
- nexaai/mlx_backend/sd/modeling/tokenizer.py +100 -0
- nexaai/mlx_backend/sd/modeling/unet.py +460 -0
- nexaai/mlx_backend/sd/modeling/vae.py +274 -0
- nexaai/mlx_backend/tts/__init__.py +12 -0
- nexaai/mlx_backend/tts/interface.py +276 -0
- nexaai/mlx_backend/vlm/__init__.py +3 -0
- nexaai/mlx_backend/vlm/generate.py +572 -0
- nexaai/mlx_backend/vlm/interface.py +406 -0
- nexaai/mlx_backend/vlm/main.py +157 -0
- nexaai/mlx_backend/vlm/modeling/__init__.py +0 -0
- nexaai/mlx_backend/vlm/modeling/convert.py +68 -0
- nexaai/mlx_backend/vlm/modeling/models/__init__.py +0 -0
- nexaai/mlx_backend/vlm/modeling/models/aya_vision/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/aya_vision/aya_vision.py +193 -0
- nexaai/mlx_backend/vlm/modeling/models/aya_vision/interpolate.py +186 -0
- nexaai/mlx_backend/vlm/modeling/models/aya_vision/language.py +233 -0
- nexaai/mlx_backend/vlm/modeling/models/aya_vision/vision.py +503 -0
- nexaai/mlx_backend/vlm/modeling/models/base.py +202 -0
- nexaai/mlx_backend/vlm/modeling/models/cache.py +230 -0
- nexaai/mlx_backend/vlm/modeling/models/deepseek_vl_v2/__init__.py +10 -0
- nexaai/mlx_backend/vlm/modeling/models/deepseek_vl_v2/conversation.py +264 -0
- nexaai/mlx_backend/vlm/modeling/models/deepseek_vl_v2/deepseek_vl_v2.py +472 -0
- nexaai/mlx_backend/vlm/modeling/models/deepseek_vl_v2/language.py +591 -0
- nexaai/mlx_backend/vlm/modeling/models/deepseek_vl_v2/processing_deepsek_vl_v2.py +526 -0
- nexaai/mlx_backend/vlm/modeling/models/deepseek_vl_v2/vision.py +356 -0
- nexaai/mlx_backend/vlm/modeling/models/florence2/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/florence2/florence2.py +366 -0
- nexaai/mlx_backend/vlm/modeling/models/florence2/language.py +488 -0
- nexaai/mlx_backend/vlm/modeling/models/florence2/vision.py +591 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3/gemma3.py +213 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3/language.py +315 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3/vision.py +238 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3n/__init__.py +2 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3n/audio.py +1038 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3n/config.py +139 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3n/gemma3n.py +322 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3n/language.py +629 -0
- nexaai/mlx_backend/vlm/modeling/models/gemma3n/vision.py +1022 -0
- nexaai/mlx_backend/vlm/modeling/models/idefics2/__init__.py +9 -0
- nexaai/mlx_backend/vlm/modeling/models/idefics2/idefics2.py +294 -0
- nexaai/mlx_backend/vlm/modeling/models/idefics2/language.py +191 -0
- nexaai/mlx_backend/vlm/modeling/models/idefics2/vision.py +267 -0
- nexaai/mlx_backend/vlm/modeling/models/idefics3/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/idefics3/idefics3.py +175 -0
- nexaai/mlx_backend/vlm/modeling/models/idefics3/language.py +192 -0
- nexaai/mlx_backend/vlm/modeling/models/idefics3/vision.py +233 -0
- nexaai/mlx_backend/vlm/modeling/models/internvl_chat/__init__.py +9 -0
- nexaai/mlx_backend/vlm/modeling/models/internvl_chat/internvl_chat.py +140 -0
- nexaai/mlx_backend/vlm/modeling/models/internvl_chat/language.py +220 -0
- nexaai/mlx_backend/vlm/modeling/models/internvl_chat/processor.py +393 -0
- nexaai/mlx_backend/vlm/modeling/models/internvl_chat/vision.py +293 -0
- nexaai/mlx_backend/vlm/modeling/models/kernels.py +307 -0
- nexaai/mlx_backend/vlm/modeling/models/kimi_vl/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/kimi_vl/kimi_vl.py +143 -0
- nexaai/mlx_backend/vlm/modeling/models/kimi_vl/language.py +509 -0
- nexaai/mlx_backend/vlm/modeling/models/kimi_vl/vision.py +522 -0
- nexaai/mlx_backend/vlm/modeling/models/llama4/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/llama4/language.py +386 -0
- nexaai/mlx_backend/vlm/modeling/models/llama4/llama4.py +138 -0
- nexaai/mlx_backend/vlm/modeling/models/llama4/vision.py +560 -0
- nexaai/mlx_backend/vlm/modeling/models/llava/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/llava/language.py +240 -0
- nexaai/mlx_backend/vlm/modeling/models/llava/llava.py +153 -0
- nexaai/mlx_backend/vlm/modeling/models/llava/vision.py +259 -0
- nexaai/mlx_backend/vlm/modeling/models/llava_bunny/__init__.py +9 -0
- nexaai/mlx_backend/vlm/modeling/models/llava_bunny/language.py +236 -0
- nexaai/mlx_backend/vlm/modeling/models/llava_bunny/llava_bunny.py +256 -0
- nexaai/mlx_backend/vlm/modeling/models/llava_bunny/vision.py +303 -0
- nexaai/mlx_backend/vlm/modeling/models/llava_next/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/llava_next/language.py +230 -0
- nexaai/mlx_backend/vlm/modeling/models/llava_next/llava_next.py +160 -0
- nexaai/mlx_backend/vlm/modeling/models/llava_next/vision.py +243 -0
- nexaai/mlx_backend/vlm/modeling/models/mistral3/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/mistral3/mistral3.py +283 -0
- nexaai/mlx_backend/vlm/modeling/models/mllama/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/mllama/language.py +416 -0
- nexaai/mlx_backend/vlm/modeling/models/mllama/mllama.py +172 -0
- nexaai/mlx_backend/vlm/modeling/models/mllama/vision.py +499 -0
- nexaai/mlx_backend/vlm/modeling/models/molmo/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/molmo/language.py +243 -0
- nexaai/mlx_backend/vlm/modeling/models/molmo/molmo.py +133 -0
- nexaai/mlx_backend/vlm/modeling/models/molmo/vision.py +465 -0
- nexaai/mlx_backend/vlm/modeling/models/multi_modality/__init__.py +10 -0
- nexaai/mlx_backend/vlm/modeling/models/multi_modality/language.py +230 -0
- nexaai/mlx_backend/vlm/modeling/models/multi_modality/multi_modality.py +385 -0
- nexaai/mlx_backend/vlm/modeling/models/multi_modality/sam.py +557 -0
- nexaai/mlx_backend/vlm/modeling/models/multi_modality/vision.py +526 -0
- nexaai/mlx_backend/vlm/modeling/models/paligemma/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/paligemma/language.py +282 -0
- nexaai/mlx_backend/vlm/modeling/models/paligemma/paligemma.py +160 -0
- nexaai/mlx_backend/vlm/modeling/models/paligemma/vision.py +242 -0
- nexaai/mlx_backend/vlm/modeling/models/phi3_v/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/phi3_v/language.py +21 -0
- nexaai/mlx_backend/vlm/modeling/models/phi3_v/phi3_v.py +243 -0
- nexaai/mlx_backend/vlm/modeling/models/phi3_v/su_rope.py +71 -0
- nexaai/mlx_backend/vlm/modeling/models/phi3_v/vision.py +324 -0
- nexaai/mlx_backend/vlm/modeling/models/pixtral/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/pixtral/language.py +229 -0
- nexaai/mlx_backend/vlm/modeling/models/pixtral/pixtral.py +161 -0
- nexaai/mlx_backend/vlm/modeling/models/pixtral/vision.py +320 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_5_vl/__init__.py +2 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_5_vl/config.py +108 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_5_vl/language.py +490 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_5_vl/qwen2_5_vl.py +168 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_5_vl/vision.py +414 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_vl/__init__.py +2 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_vl/config.py +104 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_vl/language.py +490 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_vl/qwen2_vl.py +167 -0
- nexaai/mlx_backend/vlm/modeling/models/qwen2_vl/vision.py +312 -0
- nexaai/mlx_backend/vlm/modeling/models/smolvlm/__init__.py +8 -0
- nexaai/mlx_backend/vlm/modeling/models/smolvlm/smolvlm.py +62 -0
- nexaai/mlx_backend/vlm/modeling/processing_qwen2_5_vl.py +209 -0
- nexaai/mlx_backend/vlm/modeling/processing_qwen2_vl.py +215 -0
- nexaai/mlx_backend/vlm/modeling/prompt_utils.py +474 -0
- nexaai/mlx_backend/vlm/modeling/sample_utils.py +39 -0
- nexaai/mlx_backend/vlm/modeling/tokenizer_utils.py +344 -0
- nexaai/mlx_backend/vlm/modeling/trainer/__init__.py +9 -0
- nexaai/mlx_backend/vlm/modeling/trainer/lora.py +70 -0
- nexaai/mlx_backend/vlm/modeling/trainer/trainer.py +296 -0
- nexaai/mlx_backend/vlm/modeling/trainer/utils.py +160 -0
- nexaai/mlx_backend/vlm/modeling/utils.py +928 -0
- nexaai/rerank.py +51 -0
- nexaai/rerank_impl/__init__.py +0 -0
- nexaai/rerank_impl/mlx_rerank_impl.py +91 -0
- nexaai/rerank_impl/pybind_rerank_impl.py +42 -0
- nexaai/runtime.py +64 -0
- nexaai/tts.py +70 -0
- nexaai/tts_impl/__init__.py +0 -0
- nexaai/tts_impl/mlx_tts_impl.py +93 -0
- nexaai/tts_impl/pybind_tts_impl.py +42 -0
- nexaai/utils/avatar_fetcher.py +104 -0
- nexaai/utils/decode.py +18 -0
- nexaai/utils/model_manager.py +1195 -0
- nexaai/utils/progress_tracker.py +372 -0
- nexaai/vlm.py +120 -0
- nexaai/vlm_impl/__init__.py +0 -0
- nexaai/vlm_impl/mlx_vlm_impl.py +205 -0
- nexaai/vlm_impl/pybind_vlm_impl.py +228 -0
- nexaai-1.0.4rc10.dist-info/METADATA +26 -0
- nexaai-1.0.4rc10.dist-info/RECORD +519 -0
- nexaai-1.0.4rc10.dist-info/WHEEL +5 -0
- nexaai-1.0.4rc10.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
from typing import Generator, Optional, List, Dict, Any
|
|
2
|
+
|
|
3
|
+
from nexaai.common import ModelConfig, GenerationConfig, MultiModalMessage
|
|
4
|
+
from nexaai.vlm import VLM
|
|
5
|
+
from nexaai.mlx_backend.vlm.interface import VLM as MLXVLMInterface
|
|
6
|
+
from nexaai.mlx_backend.ml import ModelConfig as MLXModelConfig, SamplerConfig as MLXSamplerConfig, GenerationConfig as MLXGenerationConfig, EmbeddingConfig
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class MlxVlmImpl(VLM):
|
|
10
|
+
def __init__(self, m_cfg: ModelConfig = ModelConfig()):
|
|
11
|
+
"""Initialize MLX VLM implementation."""
|
|
12
|
+
super().__init__(m_cfg)
|
|
13
|
+
self._mlx_vlm = None
|
|
14
|
+
|
|
15
|
+
@classmethod
|
|
16
|
+
def _load_from(cls,
|
|
17
|
+
local_path: str,
|
|
18
|
+
mmproj_path: str,
|
|
19
|
+
m_cfg: ModelConfig = ModelConfig(),
|
|
20
|
+
plugin_id: str = "mlx",
|
|
21
|
+
device_id: Optional[str] = None
|
|
22
|
+
) -> 'MlxVlmImpl':
|
|
23
|
+
"""Load VLM model from local path using MLX backend.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
local_path: Path to the main model file
|
|
27
|
+
mmproj_path: Path to the multimodal projection file (not used in MLX VLM)
|
|
28
|
+
m_cfg: Model configuration
|
|
29
|
+
plugin_id: Plugin identifier
|
|
30
|
+
device_id: Optional device ID
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
MlxVlmImpl instance
|
|
34
|
+
"""
|
|
35
|
+
try:
|
|
36
|
+
# MLX interface is already imported
|
|
37
|
+
|
|
38
|
+
# Create instance and load MLX VLM
|
|
39
|
+
instance = cls(m_cfg)
|
|
40
|
+
instance._mlx_vlm = MLXVLMInterface(
|
|
41
|
+
model_path=local_path,
|
|
42
|
+
mmproj_path=mmproj_path, # MLX VLM may not use this, but pass it anyway
|
|
43
|
+
context_length=m_cfg.n_ctx,
|
|
44
|
+
device=device_id
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return instance
|
|
48
|
+
except Exception as e:
|
|
49
|
+
raise RuntimeError(f"Failed to load MLX VLM: {str(e)}")
|
|
50
|
+
|
|
51
|
+
def eject(self):
|
|
52
|
+
"""Release the model from memory."""
|
|
53
|
+
if self._mlx_vlm:
|
|
54
|
+
self._mlx_vlm.destroy()
|
|
55
|
+
self._mlx_vlm = None
|
|
56
|
+
|
|
57
|
+
def reset(self):
|
|
58
|
+
"""
|
|
59
|
+
Reset the VLM model context and KV cache.
|
|
60
|
+
"""
|
|
61
|
+
if not self._mlx_vlm:
|
|
62
|
+
raise RuntimeError("MLX VLM not loaded")
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
self._mlx_vlm.reset()
|
|
66
|
+
except Exception as e:
|
|
67
|
+
raise RuntimeError(f"Failed to reset MLX VLM: {str(e)}")
|
|
68
|
+
|
|
69
|
+
def apply_chat_template(
|
|
70
|
+
self,
|
|
71
|
+
messages: List[MultiModalMessage],
|
|
72
|
+
tools: Optional[List[Dict[str, Any]]] = None
|
|
73
|
+
) -> str:
|
|
74
|
+
"""Apply the chat template to multimodal messages."""
|
|
75
|
+
if not self._mlx_vlm:
|
|
76
|
+
raise RuntimeError("MLX VLM not loaded")
|
|
77
|
+
|
|
78
|
+
try:
|
|
79
|
+
# Convert MultiModalMessage to MLX format
|
|
80
|
+
mlx_messages = []
|
|
81
|
+
for msg in messages:
|
|
82
|
+
# Create a simple object with role and content attributes
|
|
83
|
+
class MLXChatMessage:
|
|
84
|
+
def __init__(self, role, content):
|
|
85
|
+
self.role = role
|
|
86
|
+
self.content = content
|
|
87
|
+
|
|
88
|
+
# For MLX VLM, we need to extract text content from multimodal messages
|
|
89
|
+
# This is a simplified approach - the actual implementation may need
|
|
90
|
+
# more sophisticated handling of different content types
|
|
91
|
+
text_content = ""
|
|
92
|
+
for content_item in msg["content"]:
|
|
93
|
+
if content_item["type"] == "text":
|
|
94
|
+
text_content += content_item.get("text", "")
|
|
95
|
+
# Note: image/audio/video content is typically handled separately
|
|
96
|
+
# in the generation phase, not in the chat template
|
|
97
|
+
|
|
98
|
+
mlx_messages.append(MLXChatMessage(msg["role"], text_content))
|
|
99
|
+
|
|
100
|
+
return self._mlx_vlm.apply_chat_template(mlx_messages)
|
|
101
|
+
except Exception as e:
|
|
102
|
+
raise RuntimeError(f"Failed to apply chat template: {str(e)}")
|
|
103
|
+
|
|
104
|
+
def generate_stream(self, prompt: str, g_cfg: GenerationConfig = GenerationConfig()) -> Generator[str, None, None]:
|
|
105
|
+
"""Generate text with streaming."""
|
|
106
|
+
if not self._mlx_vlm:
|
|
107
|
+
raise RuntimeError("MLX VLM not loaded")
|
|
108
|
+
|
|
109
|
+
try:
|
|
110
|
+
# Get MLX config classes
|
|
111
|
+
_, MLXSamplerConfig, MLXGenerationConfig, _ = get_mlx_configs()
|
|
112
|
+
|
|
113
|
+
# Convert GenerationConfig to MLX format
|
|
114
|
+
mlx_gen_config = MLXGenerationConfig()
|
|
115
|
+
mlx_gen_config.max_tokens = g_cfg.max_tokens
|
|
116
|
+
mlx_gen_config.stop = g_cfg.stop_words
|
|
117
|
+
mlx_gen_config.image_paths = g_cfg.image_paths
|
|
118
|
+
mlx_gen_config.audio_paths = g_cfg.audio_paths
|
|
119
|
+
|
|
120
|
+
if g_cfg.sampler_config:
|
|
121
|
+
mlx_sampler_config = MLXSamplerConfig()
|
|
122
|
+
mlx_sampler_config.temperature = g_cfg.sampler_config.temperature
|
|
123
|
+
mlx_sampler_config.top_p = g_cfg.sampler_config.top_p
|
|
124
|
+
mlx_sampler_config.top_k = g_cfg.sampler_config.top_k
|
|
125
|
+
mlx_sampler_config.repetition_penalty = g_cfg.sampler_config.repetition_penalty
|
|
126
|
+
mlx_sampler_config.presence_penalty = g_cfg.sampler_config.presence_penalty
|
|
127
|
+
mlx_sampler_config.frequency_penalty = g_cfg.sampler_config.frequency_penalty
|
|
128
|
+
mlx_sampler_config.seed = g_cfg.sampler_config.seed
|
|
129
|
+
mlx_sampler_config.grammar_path = g_cfg.sampler_config.grammar_path
|
|
130
|
+
mlx_sampler_config.grammar_string = g_cfg.sampler_config.grammar_string
|
|
131
|
+
mlx_gen_config.sampler_config = mlx_sampler_config
|
|
132
|
+
|
|
133
|
+
# Create a token callback for streaming
|
|
134
|
+
def token_callback(token: str) -> bool:
|
|
135
|
+
# Check if generation should be cancelled
|
|
136
|
+
return not self._cancel_event.is_set()
|
|
137
|
+
|
|
138
|
+
# Use MLX VLM streaming generation
|
|
139
|
+
result = self._mlx_vlm.generate_stream(prompt, mlx_gen_config, token_callback)
|
|
140
|
+
|
|
141
|
+
# MLX VLM interface returns a GenerationResult, extract the text
|
|
142
|
+
if hasattr(result, 'text') and result.text:
|
|
143
|
+
# Split the result into words and yield them
|
|
144
|
+
words = result.text.split()
|
|
145
|
+
for i, word in enumerate(words):
|
|
146
|
+
if self._cancel_event.is_set():
|
|
147
|
+
break
|
|
148
|
+
if i == 0:
|
|
149
|
+
yield word
|
|
150
|
+
else:
|
|
151
|
+
yield " " + word
|
|
152
|
+
|
|
153
|
+
except Exception as e:
|
|
154
|
+
raise RuntimeError(f"Failed to generate streaming text: {str(e)}")
|
|
155
|
+
|
|
156
|
+
def generate(self, prompt: str, g_cfg: GenerationConfig = GenerationConfig()) -> str:
|
|
157
|
+
"""
|
|
158
|
+
Generate text without streaming.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
prompt (str): The prompt to generate text from.
|
|
162
|
+
g_cfg (GenerationConfig): Generation configuration.
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
str: The generated text.
|
|
166
|
+
"""
|
|
167
|
+
if not self._mlx_vlm:
|
|
168
|
+
raise RuntimeError("MLX VLM not loaded")
|
|
169
|
+
|
|
170
|
+
try:
|
|
171
|
+
# Get MLX config classes
|
|
172
|
+
_, MLXSamplerConfig, MLXGenerationConfig, _ = get_mlx_configs()
|
|
173
|
+
|
|
174
|
+
# Convert GenerationConfig to MLX format
|
|
175
|
+
mlx_gen_config = MLXGenerationConfig()
|
|
176
|
+
mlx_gen_config.max_tokens = g_cfg.max_tokens
|
|
177
|
+
mlx_gen_config.stop = g_cfg.stop_words
|
|
178
|
+
mlx_gen_config.image_paths = g_cfg.image_paths
|
|
179
|
+
mlx_gen_config.audio_paths = g_cfg.audio_paths
|
|
180
|
+
|
|
181
|
+
if g_cfg.sampler_config:
|
|
182
|
+
mlx_sampler_config = MLXSamplerConfig()
|
|
183
|
+
mlx_sampler_config.temperature = g_cfg.sampler_config.temperature
|
|
184
|
+
mlx_sampler_config.top_p = g_cfg.sampler_config.top_p
|
|
185
|
+
mlx_sampler_config.top_k = g_cfg.sampler_config.top_k
|
|
186
|
+
mlx_sampler_config.repetition_penalty = g_cfg.sampler_config.repetition_penalty
|
|
187
|
+
mlx_sampler_config.presence_penalty = g_cfg.sampler_config.presence_penalty
|
|
188
|
+
mlx_sampler_config.frequency_penalty = g_cfg.sampler_config.frequency_penalty
|
|
189
|
+
mlx_sampler_config.seed = g_cfg.sampler_config.seed
|
|
190
|
+
mlx_sampler_config.grammar_path = g_cfg.sampler_config.grammar_path
|
|
191
|
+
mlx_sampler_config.grammar_string = g_cfg.sampler_config.grammar_string
|
|
192
|
+
mlx_gen_config.sampler_config = mlx_sampler_config
|
|
193
|
+
|
|
194
|
+
# Use MLX VLM generation
|
|
195
|
+
result = self._mlx_vlm.generate(prompt, mlx_gen_config)
|
|
196
|
+
|
|
197
|
+
# MLX VLM interface returns a GenerationResult, extract the text
|
|
198
|
+
if hasattr(result, 'text'):
|
|
199
|
+
return result.text
|
|
200
|
+
else:
|
|
201
|
+
# Fallback if result is just a string
|
|
202
|
+
return str(result)
|
|
203
|
+
|
|
204
|
+
except Exception as e:
|
|
205
|
+
raise RuntimeError(f"Failed to generate text: {str(e)}")
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
from typing import Generator, Optional, List, Dict, Any, Union
|
|
2
|
+
import queue
|
|
3
|
+
import threading
|
|
4
|
+
import base64
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from nexaai.common import ModelConfig, GenerationConfig, MultiModalMessage
|
|
8
|
+
from nexaai.binds import vlm_bind, common_bind
|
|
9
|
+
from nexaai.runtime import _ensure_runtime
|
|
10
|
+
from nexaai.vlm import VLM
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PyBindVLMImpl(VLM):
|
|
14
|
+
def __init__(self, handle: any, m_cfg: ModelConfig = ModelConfig()):
|
|
15
|
+
"""Private constructor, should not be called directly."""
|
|
16
|
+
super().__init__(m_cfg)
|
|
17
|
+
self._handle = handle # This is a py::capsule
|
|
18
|
+
|
|
19
|
+
@classmethod
|
|
20
|
+
def _load_from(cls,
|
|
21
|
+
local_path: str,
|
|
22
|
+
mmproj_path: str,
|
|
23
|
+
m_cfg: ModelConfig = ModelConfig(),
|
|
24
|
+
plugin_id: str = "llama_cpp",
|
|
25
|
+
device_id: Optional[str] = None
|
|
26
|
+
) -> 'PyBindVLMImpl':
|
|
27
|
+
"""Load VLM model from local path.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
local_path: Path to the main model file
|
|
31
|
+
mmproj_path: Path to the multimodal projection file
|
|
32
|
+
m_cfg: Model configuration
|
|
33
|
+
plugin_id: Plugin identifier
|
|
34
|
+
device_id: Optional device ID (not used in current binding)
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
PyBindVLMImpl instance
|
|
38
|
+
"""
|
|
39
|
+
_ensure_runtime()
|
|
40
|
+
|
|
41
|
+
config = common_bind.ModelConfig()
|
|
42
|
+
|
|
43
|
+
config.n_ctx = m_cfg.n_ctx
|
|
44
|
+
if m_cfg.n_threads is not None:
|
|
45
|
+
config.n_threads = m_cfg.n_threads
|
|
46
|
+
if m_cfg.n_threads_batch is not None:
|
|
47
|
+
config.n_threads_batch = m_cfg.n_threads_batch
|
|
48
|
+
if m_cfg.n_batch is not None:
|
|
49
|
+
config.n_batch = m_cfg.n_batch
|
|
50
|
+
if m_cfg.n_ubatch is not None:
|
|
51
|
+
config.n_ubatch = m_cfg.n_ubatch
|
|
52
|
+
if m_cfg.n_seq_max is not None:
|
|
53
|
+
config.n_seq_max = m_cfg.n_seq_max
|
|
54
|
+
config.n_gpu_layers = m_cfg.n_gpu_layers
|
|
55
|
+
|
|
56
|
+
# handle chat template strings
|
|
57
|
+
if m_cfg.chat_template_path:
|
|
58
|
+
config.chat_template_path = m_cfg.chat_template_path
|
|
59
|
+
|
|
60
|
+
if m_cfg.chat_template_content:
|
|
61
|
+
config.chat_template_content = m_cfg.chat_template_content
|
|
62
|
+
|
|
63
|
+
# Create handle : returns py::capsule with automatic cleanup
|
|
64
|
+
handle = vlm_bind.create_vlm(
|
|
65
|
+
model_path=local_path,
|
|
66
|
+
mmproj_path=mmproj_path,
|
|
67
|
+
model_config=config,
|
|
68
|
+
plugin_id=plugin_id,
|
|
69
|
+
device_id=device_id
|
|
70
|
+
)
|
|
71
|
+
return cls(handle, m_cfg)
|
|
72
|
+
|
|
73
|
+
def eject(self):
|
|
74
|
+
"""Release the model from memory."""
|
|
75
|
+
# py::capsule handles cleanup automatically
|
|
76
|
+
del self._handle
|
|
77
|
+
self._handle = None
|
|
78
|
+
|
|
79
|
+
def reset(self):
|
|
80
|
+
"""
|
|
81
|
+
Reset the VLM model context and KV cache. If not reset, the model will skip the number of evaluated tokens and treat tokens after those as the new incremental tokens.
|
|
82
|
+
If your past chat history changed, or you are starting a new chat, you should always reset the model before running generate.
|
|
83
|
+
"""
|
|
84
|
+
vlm_bind.ml_vlm_reset(self._handle)
|
|
85
|
+
|
|
86
|
+
def apply_chat_template(
|
|
87
|
+
self,
|
|
88
|
+
messages: List[MultiModalMessage],
|
|
89
|
+
tools: Optional[List[Dict[str, Any]]] = None
|
|
90
|
+
) -> str:
|
|
91
|
+
"""Apply the chat template to multimodal messages."""
|
|
92
|
+
payload = []
|
|
93
|
+
for msg in messages:
|
|
94
|
+
role = msg["role"]
|
|
95
|
+
blocks = []
|
|
96
|
+
|
|
97
|
+
for c in msg["content"]:
|
|
98
|
+
t = c["type"]
|
|
99
|
+
if t == "text":
|
|
100
|
+
blocks.append({"type": "text", "text": c.get("text","") or ""})
|
|
101
|
+
else:
|
|
102
|
+
# image/audio/video
|
|
103
|
+
src = c.get("url") or c.get("path")
|
|
104
|
+
if not src:
|
|
105
|
+
raise ValueError(f"No url/path for {t}")
|
|
106
|
+
# read local file or strip data URI
|
|
107
|
+
if Path(src).exists():
|
|
108
|
+
raw = Path(src).read_bytes()
|
|
109
|
+
b64 = base64.b64encode(raw).decode("ascii")
|
|
110
|
+
blocks.append({"type": t, "text": b64})
|
|
111
|
+
elif src.startswith("data:"):
|
|
112
|
+
b64 = src.split(",",1)[1]
|
|
113
|
+
blocks.append({"type": t, "text": b64})
|
|
114
|
+
else:
|
|
115
|
+
# remote URL
|
|
116
|
+
blocks.append({"type": t, "text": src})
|
|
117
|
+
|
|
118
|
+
payload.append({"role": role, "content": blocks})
|
|
119
|
+
|
|
120
|
+
return vlm_bind.ml_vlm_apply_chat_template(self._handle, payload, tools)
|
|
121
|
+
|
|
122
|
+
def generate_stream(self, prompt: str, g_cfg: GenerationConfig = GenerationConfig()) -> Generator[str, None, None]:
|
|
123
|
+
"""Generate text with streaming."""
|
|
124
|
+
token_queue = queue.Queue()
|
|
125
|
+
exception_container = [None]
|
|
126
|
+
self.reset_cancel() # Reset cancel flag before generation
|
|
127
|
+
|
|
128
|
+
def on_token(token: str, user_data) -> bool:
|
|
129
|
+
if self._cancel_event.is_set():
|
|
130
|
+
token_queue.put(('end', None))
|
|
131
|
+
return False # Stop generation
|
|
132
|
+
try:
|
|
133
|
+
token_queue.put(('token', token))
|
|
134
|
+
return True # Continue generation
|
|
135
|
+
except Exception as e:
|
|
136
|
+
exception_container[0] = e
|
|
137
|
+
return False # Stop generation
|
|
138
|
+
|
|
139
|
+
config = self._convert_generation_config(g_cfg)
|
|
140
|
+
|
|
141
|
+
# Run generation in thread
|
|
142
|
+
def generate():
|
|
143
|
+
try:
|
|
144
|
+
vlm_bind.ml_vlm_generate(
|
|
145
|
+
handle=self._handle,
|
|
146
|
+
prompt=prompt,
|
|
147
|
+
config=config,
|
|
148
|
+
on_token=on_token,
|
|
149
|
+
user_data=None
|
|
150
|
+
)
|
|
151
|
+
except Exception as e:
|
|
152
|
+
exception_container[0] = e
|
|
153
|
+
finally:
|
|
154
|
+
token_queue.put(('end', None))
|
|
155
|
+
|
|
156
|
+
thread = threading.Thread(target=generate)
|
|
157
|
+
thread.start()
|
|
158
|
+
|
|
159
|
+
# Yield tokens as they come
|
|
160
|
+
try:
|
|
161
|
+
while True:
|
|
162
|
+
msg_type, token = token_queue.get()
|
|
163
|
+
if msg_type == 'token':
|
|
164
|
+
yield token
|
|
165
|
+
elif msg_type in ('error', 'end'):
|
|
166
|
+
break
|
|
167
|
+
finally:
|
|
168
|
+
thread.join()
|
|
169
|
+
|
|
170
|
+
if exception_container[0]:
|
|
171
|
+
raise exception_container[0]
|
|
172
|
+
|
|
173
|
+
def generate(self, prompt: str, g_cfg: GenerationConfig = GenerationConfig()) -> str:
|
|
174
|
+
"""
|
|
175
|
+
Generate text without streaming.
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
prompt (str): The prompt to generate text from. For chat models, this is the chat messages after chat template is applied.
|
|
179
|
+
g_cfg (GenerationConfig): Generation configuration.
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
str: The generated text.
|
|
183
|
+
"""
|
|
184
|
+
config = self._convert_generation_config(g_cfg)
|
|
185
|
+
result = vlm_bind.ml_vlm_generate(
|
|
186
|
+
handle=self._handle,
|
|
187
|
+
prompt=prompt,
|
|
188
|
+
config=config,
|
|
189
|
+
on_token=None, # No callback for non-streaming
|
|
190
|
+
user_data=None
|
|
191
|
+
)
|
|
192
|
+
return result.get("text", "")
|
|
193
|
+
|
|
194
|
+
def _convert_generation_config(self, g_cfg: GenerationConfig):
|
|
195
|
+
"""Convert GenerationConfig to binding format."""
|
|
196
|
+
config = common_bind.GenerationConfig()
|
|
197
|
+
|
|
198
|
+
# Set basic generation parameters
|
|
199
|
+
config.max_tokens = g_cfg.max_tokens
|
|
200
|
+
|
|
201
|
+
if g_cfg.stop_words:
|
|
202
|
+
config.stop = g_cfg.stop_words
|
|
203
|
+
|
|
204
|
+
if g_cfg.image_paths:
|
|
205
|
+
config.image_paths = g_cfg.image_paths
|
|
206
|
+
|
|
207
|
+
if g_cfg.audio_paths:
|
|
208
|
+
config.audio_paths = g_cfg.audio_paths
|
|
209
|
+
|
|
210
|
+
if g_cfg.sampler_config:
|
|
211
|
+
sampler = common_bind.SamplerConfig()
|
|
212
|
+
sampler.temperature = g_cfg.sampler_config.temperature
|
|
213
|
+
sampler.top_p = g_cfg.sampler_config.top_p
|
|
214
|
+
sampler.top_k = g_cfg.sampler_config.top_k
|
|
215
|
+
sampler.repetition_penalty = g_cfg.sampler_config.repetition_penalty
|
|
216
|
+
sampler.presence_penalty = g_cfg.sampler_config.presence_penalty
|
|
217
|
+
sampler.frequency_penalty = g_cfg.sampler_config.frequency_penalty
|
|
218
|
+
sampler.seed = g_cfg.sampler_config.seed
|
|
219
|
+
|
|
220
|
+
if g_cfg.sampler_config.grammar_path:
|
|
221
|
+
sampler.grammar_path = g_cfg.sampler_config.grammar_path
|
|
222
|
+
|
|
223
|
+
if g_cfg.sampler_config.grammar_string:
|
|
224
|
+
sampler.grammar_string = g_cfg.sampler_config.grammar_string
|
|
225
|
+
|
|
226
|
+
config.sampler_config = sampler
|
|
227
|
+
|
|
228
|
+
return config
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nexaai
|
|
3
|
+
Version: 1.0.4rc10
|
|
4
|
+
Summary: Python bindings for NexaSDK C-lib backend
|
|
5
|
+
Author-email: "Nexa AI, Inc." <dev@nexa.ai>
|
|
6
|
+
Project-URL: Homepage, https://github.com/NexaAI/nexasdk-bridge
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
|
+
Requires-Python: >=3.7
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
Requires-Dist: huggingface_hub
|
|
16
|
+
Requires-Dist: tqdm
|
|
17
|
+
Requires-Dist: hf_xet
|
|
18
|
+
Requires-Dist: numpy
|
|
19
|
+
Requires-Dist: httpx
|
|
20
|
+
Provides-Extra: mlx
|
|
21
|
+
Requires-Dist: mlx; extra == "mlx"
|
|
22
|
+
Requires-Dist: mlx-lm; extra == "mlx"
|
|
23
|
+
Requires-Dist: mlx-vlm; extra == "mlx"
|
|
24
|
+
Requires-Dist: tokenizers; extra == "mlx"
|
|
25
|
+
Requires-Dist: safetensors; extra == "mlx"
|
|
26
|
+
Requires-Dist: Pillow; extra == "mlx"
|