how FlashRAG load model did it load local model download a model if one not found or use…
- User
how FlashRAG load model did it load local model download a model if one not found or use an api?
Assistant
FlashRAG primarily loads models from local paths specified in configurations and does not automatically download models if they're not found locally.
Model Loading Approach
FlashRAG expects users to download required models before using the toolkit. The framework works with locally stored models specified through configuration files or command-line arguments[1][2]. This is evident from how model paths are provided in various commands:
# Example from configuration config_dict = { 'model2path': {'e5': <retriever_path>, 'llama2-7B-chat': <generator_path>}, 'generator_model': 'llama2-7B-chat', 'retrieval_method': 'e5' }- User
did it support using 4bit model istend of full size?
Assistant
FlashRAG does not appear to support 4-bit quantized models directly. Based on the documentation, FlashRAG primarily supports half-precision (fp16) models rather than more aggressive quantization methods like 4-bit.
The toolkit provides configuration options for fp16 precision in various components:
retrieval_use_fp16: True # whether to use fp16 for retrieval model rerank_use_fp16: True # whether to use fp16 for rerankerThis can be seen in the index building command as well:
python -m flashrag.retriever.index_builder \ --retrieval_method e5 \ --model_path /model/e5-base-v2/ \ --corpus_path indexes/sample_corpus.jsonl \ --save_dir indexes/ \ --use_fp16 \ --max_length 512While FlashRAG integrates with vLLM for inference acceleration, which could theoretically support more aggressive quantization, there is no explicit documentation of 4-bit model support in the toolkit's configuration options or features list.
This differs from some other RAG frameworks like RAGLAB, which explicitly supports 4-bit quantization through QLoRA for running very large models like Llama3-70B with limited computational resources.