Additional option for alternative model Paths to load different model formats #335
Replies: 4 comments 1 reply
-
@John42506176Linux Your request is not realistic. Besides model weights, you also need to load e.g. the config files, tokenizer, and infer the model class from the config. I would suggest you to pack your custom reranker into a huggingface repo. I am confused, as for loading onnx models you need to set —engine optimum, which you are not doing. |
Beta Was this translation helpful? Give feedback.
-
Thanks, for the information I didn't know if this was an option so wanted to double-check. I didn't include the --engine optimum option in the contribution but that was used in testing. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I'll move it to discussions. |
Beta Was this translation helpful? Give feedback.
-
This function decides which onnx file is chosen based on the model_name_or_path and revision. But consider a hf model like https://huggingface.co/Xenova/bge-small-en-v1.5/tree/main/onnx where it has 3 kinds of onnx files which vary in quantization and they have their own naming convention. I would be great if we can pass the exact onnx file name that needs to be chosen instead of implicity infering it based on provider to decide whether to chose the quantized onnx file. I'm refering to how the value of prefer_quantized is derived.
Expectation: @michaelfeil looking forward to your take on this. |
Beta Was this translation helpful? Give feedback.
-
Feature request
Additional optional for Docker CLI to load alternative paths of models
port=7997
mid_rerank_model=mixedbread-ai/mxbai-rerank-xsmall-v1
volume=$PWD/data
sudo docker run -it --gpus all
-v $volume:/app/.cache
-p $port:$port
michaelf34/infinity:latest
v2
--batch-size 32
--model-id $mid_rerank_model
--alternative_path onnx/model_quantized.onnx
--port $port
Motivation
I'm currently trying to load the quantized ONNX version of a Reranker model I'm using and I currently can't see an easy solution to doing this with the docker CLI.
Your contribution
Help test or fix few simple bugs.
Beta Was this translation helpful? Give feedback.
All reactions