Frequently-asked-questions
Here are some common questions encountered during the use of SWIFT.
Dataset
SWIFT comes with 150+ built-in datasets for various tasks such as pre-training, fine-tuning, human eye alignment, and multimodal simulations, and also supports custom datasets. See Homepage for details.
Q1: What datasets does SWIFT support? How do I use a custom dataset? How do I download a dataset? How do I inspect a dataset?
For a list of supported datasets, please see Supported Models and Datasets.
For details on custom dataset formats and usage, please refer to Custom Datasets. Datasets that conform to the format will automatically call Swift’s built-in data preprocessor. If the format does not match the documentation requirements, please refer to the supported datasets and convert the format yourself. If your custom dataset contains additional fields, these fields will not be used by default. You can configure them using
--remove_unused_columns.When you need to download the dataset and then use it by specifying the path, you can download it locally through
git cloneand specify it through thedataset_pathfield in the dataset_info.json file. For details, please see the Customized Dataset Document. The download mode of the data set can choose to re-download or reuse the last download, specified by--download_mode.To perform error checking on the data set, please set the command line parameter
--strict True. When you need a data set quality inspection tool, you can check out another library data-juicer. Data can be randomized using--dataset_shuffle true. For more instructions, please search for the corresponding parameters in Command Line Parameter Document.
Q2: Common Dataset Errors
Due to PyArrow’s strict type control over datasets, the
objectssection of the image grounding dataset and thetoolssection of the agent dataset must use thestrtype; otherwise, an error will occur indicating inconsistent data types across rows.If you encounter the error
AttributeError: 'TrainerState' object has no attribute 'last_model_checkpoint'during training, it may be because the dataset is too small, resulting in insufficient data for one step. Try expanding the dataset to resolve this. Similarly, a similar error will occur if the split validation set data is too small.Below is an error caused by an empty assistant field:
File "/your_workspace/ms-swift/swift/1lm/dataset/preprocessor/core.py", line 69, in _check_messages raise
ValueError(f'assistant_message; {assistant_message}')
ValueError: assistant_message: {'role' :'assistant', 'content': ''}
If it’s for inference, you can simply delete the empty assistant message.
Q7: Multi-process processing of data sets
It is normal for multi-modal dataset map to be slow. You can set the parameter --dataset_num_proc to open multiple processes to speed up.
Training
SWIFT supports training methods including pre-training, instruction-supervised fine-tuning, preference learning, GRPO, Embedding, Reranker, sequence classification tasks, etc. See Homepage for details.
Q1: How to set up a SWIFT environment? How to install SWIFT offline? Are there any mirrors available?
For detailed environment setup instructions, please refer to the SWIFT Installation Documentation. Recommended versions of some common dependencies can be found on the GitHub homepage.
SWIFT Offline Installation Process:
1. Clone the image using git (internet connection required)
2. Install locally using pip -e .
The SWIFT Installation Documentation provides the image address. Use
docker pullto pull the image anddocker runto start the container, for example:
# Pull the image
docker pull modelscope-registry.cn-hangzhou.cr.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda13.0.3-py312-torch2.11.0-vllm0.23.0-modelscope1.38.1-swift4.4.1
# Start the container in the background; -d will make the container run in the background for a long time
docker run --gpus all -p 8000:8000 -dit --name ms modelscope-registry.cn-hangzhou.cr.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda13.0.3-py312-torch2.11.0-vllm0.23.0-modelscope1.38.1-swift4.4.1 /bin/bash
# Enter the container
docker exec -it ms /bin/bash
After starting the container, pull the latest SWIFT code and install it.
Q2: What models does SWIFT support? How do I download models? How do I set the model storage path?
For a list of supported models, see Supported Models and Datasets.
If the model has already been downloaded locally, you can use it by setting
--model <model_path>. For offline training, you need to set both--model <local_path_to_model>and--check_model false. If you encounter errors related to git clone, you can specify the local repository using--local_repo_path <local_repo_path>.Models downloaded from ModelScope can be stored in a specified path by configuring the environment variable
MODELSCOPE_CACHE=your_path. If you download using the ModelScope SDK, you can also specify the model storage path using--cache_dir="local_path". Models can also be downloaded using themodelscope downloadcommand-line tool orgit. See the Model Download section of the Modelscope documentation for details. If you need to download models from Hugging Face, you need to set the environment variableUSE_HF=1.SWIFT will automatically match
model_type. You can also manually specify it by checking the Supported Models and Datasets. For more information, please search for the corresponding parameters in the Command-line Parameters Documentation.
Q4: How to debug SWIFT training?
Debugging can be done in the following way, which is equivalent to fine-tuning using the command line, but this method does not support distributed debugging. The fine-tuning command-line entry point can be found here.
from swift import sft_main, SftArguments
result = sft_main(SftArguments(
model='Qwen/Qwen2.5-7B-Instruct',
tuner_type='lora',
dataset=['AI-ModelScope/alpaca-gpt4-data-zh#500',
'AI-ModelScope/alpaca-gpt4-data-en#500',
'swift/self-cognition#500'],
torch_dtype='bfloat16',
# ...
))
Q5: How to use python script to train SWIFT?
Refer to notebook example.
Q6: How to use UI interface training for SWIFT?
Use the
swift web-uicommand to start the UI interface. Interface training and custom data set usage are consistent with the command line. For parameters on the interface, please see the Command Line Parameter Documentation.Megatron-SWIFT does not support UI interface training.
Q12: How many checkpoints are saved by default after training?
All checkpoints are saved by default. For details, see save_total_limit in the command line parameter documentation.
Q17: Expanding the Vocabulary
Expanding the vocabulary using the SWIFT framework requires setting the command-line argument --new_special_tokens <path/to/tokens.txt> in conjunction with --modules_to_save embed_tokens lm_head to unfreeze the corresponding parameters for training. See Example for details.
Q21: Thinking Model Training
See this issue.
Q22: Does SWIFT support distillation?
Refer to this example.
Q27: Does save_steps in the training script refer to the step or the global step?
It refers to the global_step, which is what the local TQDM displays.
Q28: After passing --importance_sampling_level sequence to GSPO training, does it also support passing the parameter --top_entropy_quantile? That is, can it still optimize for the top x% of tokens in the entropy distribution?
Yes, it is supported. The order is to first calculate the sequence loss normally (affected by importance_sampling_level), and then mask the loss based on top_entropy_quantile.
Q34: Training of Some Special Models
SWIFT currently does not support training MiniCPM-O using audio modal input.
Fine-tuning DeepSeek-VL-2 requires
transformers<4.42andpeft==0.11.*.Moonlight-16B-A3B-Instruct fine-tuning is hampered by training being disabled in the model file. Refer to the DeepSeek-VL-2 solution for a workaround.
Ovis2 is a special model; fine-tuning requires padding to max_length, so
--max_lengthmust be explicitly set.Qwen2.5-Omni currently only supports thinker training and does not support talker training.
Qwen2-Audio’s SFT does not support packing.
Q35: What is the default attention implemment on devices that do not support flash attention?
SDPA is used by default.
Q36: Is left padding the default for model training?
Training can choose to use either left or right padding. The default is right padding, and batch inferring always uses left padding.
Q37: Can SWIFT support setting a minimum learning rate? It seems like the final result is too small.
Yes, it can be set via:
--lr_scheduler_type cosine_with_min_lr
--lr_scheduler_kwargs '{"min_lr": 1e-6}'
Q38: Is it possible to configure grpo and sft using a YAML file?
Yes, this configuration will be processed into a command line in main.py.
Q39: Is it possible to use --use_liger_kernel and --log_entropy together?
No, it is not supported. liger does not instantiate logits, so it cannot obtain entropies.
Q41: When fine-tuning VLM for several tasks simultaneously, how to configure it when the video sampling rules for different tasks are inconsistent?
Search for --interleave_prob in the Command Line Parameters documentation.
Q42: During multimodal packing pre-training, memory usage seems to increase slightly after each PyTorch allocator cache flushes since the last step, which can easily lead to OutOfMemoryError (OOM) with many steps.
Add the environment variable PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True' to reduce memory fragmentation.
Q43: Can --use_logits_to_keep be used on large multimodal models?
It works if multimodal token expansion occurs outside the model; it throws an error if it occurs inside the model’s forward pass.
Q44: Is there any practical documentation on fine-tuning a qwen base model to a chat model? Are there any special configurations required?
Use swift sft. There are no other special configurations required. Refer to the example.
Q45: What if the model receives many duplicate responses after training?
Please refer to Pre-training and Fine-tuning. If duplicates occur during training, consider training for several epochs, cleaning the data, performing full parameter training, or using RLHF to mitigate the issue.
Q46: During full-parameter training, because the card cannot use bf16, I set --torch_dtype float16, and the following error occurred:
lib/python3.12/site-packages/torch/amp/grad_scaler.py", line 260, in _unscale_grads_ raise ValueError("Attempting to unscale FP16 gradients.") ValueError: Attempting to unscale FP16 gradients.
The value range of fp16 is very small (maximum 65504), and gradient overflow is easy during full-parameter training. You can try using --torch_dtype fp32 instead.
Q47: The following error occurred when merging LoRa parameters. Currently, Peft is version 0.11.0. Is this because the Peft version needs to be upgraded?
File "/opt/conda/lib/python3.9/site-packages/peft/config.py", line 118, in from_peft_type
return config_cls(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'corda_config'
This is caused by a mismatch between the Peft versions of the training and merging ends. The merging end needs to upgrade Peft to the same (or higher) version as the training end.
Q48: safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge
Insufficient disk space; the model was not fully saved, and the weight data was truncated.
Q49: AttributeError: module ‘numpy’ has no attribute ‘object’
Try numpy==1.26.3.
Q50: unsloth training, error: assert(type(target modules) in (list,tuple,)). The configured parameter is --target modules all-linear
Change all-linear to a specific module list, such as --target_modules q k v, and the unsloth LoRA implementation path will not expand the specific module name.
Q51: For qwen2.5-omni, –freeze_vit false means that both the visual encoder and the audio encoder are turned on. Is there any way to turn on only the audio encoder but not the visual encoder?
Use --target_regex to match only the module paths you want to train. For example:
--target_regex ".*audio.*" # Only match modules containing audio
Q52: Does Qwen3.5 support CP?
Yes, it is supported. For details, please refer to Qwen 3.5 Best Practices.
Q53: Can gkd support different system prompts for teacher and student, like opsd?
Yes, it can.
Q54: Can the MoE model be trained using deepspeed zero3?
Yes, but it will be slow.
Q55: Does megatron swift support graphics card B300?
Yes.
Q56: What if the results of running a MoE model using megatron stf and swift stf are not the same?
MoE models should be run using Megatron whenever possible, as Megatron + MoE is relatively mature. Transformers only started supporting MoE training in version 5.0 and later, so it may not be stable.
Q57: Under what circumstances should think mode be enabled during training?
If your training data involves CoT, it is recommended to enable think mode.
Q58: Do all data with <think></think> need to have the think mode enabled during training?
This depends on the specific training scenario. If the data doesn’t involve a lot of logical reasoning, you can use no-thinking.
Q59: An error occurred while training qwenvl-2.5.
[rankØ]: Original Traceback (most recent call last):
[rank0]:
File "/apdcephfs_qy3/share_300998916/weituchong/miniforge3/envs/qwen/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 349, in _worker_loop
[rank0] :
data = fetcher. fetch index)
type: ignore [possibly-undefined]
[rank0]:
File"/apdcephfs_qy3/share_300998916/weituchong/miniforge3/envs/qwen/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch
[rankø]:
data = [self-dataset [idx] for idx in possibly_batched_index]
[rankø]:
File"/apdcephfs_qy3/share_300998916/weituchong/miniforge3/envs/qwen/Lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 52, in
[rankø] :
data = [self dataset [idx] for idx in possibly_batched_index]
[rank0]:
File "/apdcephfs_qy3/share_300998916/weituchong/miniforge3/envs/qwen/lib/python3.10/site-packages/swift/llm/dataset/utils-py", line 191, in _getitem
[rank0]:
raise ValueError( 'Failed to retrieve the dataset. You can avoid this issue by increasing
'max_length'
or "
[rankø]: ValueError: Failed to retrieve the dataset. You can avoid this issue by increasing 'max_length' or modifying the 'truncation_strategy -
If there are no other error messages above, then the dataset is too long. Increase the --max_length, and as long as it doesn’t cause an OOM (Out of Memory) error, there shouldn’t be any problem.
Q60: How to perform dynamic data augmentation on image samples when training a multimodal model, i.e., augment the data once before each batch is input into the model?
Swift does not currently have out-of-the-box support for dynamic data enhancements; you can extend the source code as needed.
Q61: How many samples are typically needed for GRPO training?
A few thousand will be effective, and more will be even more effective.
Q62: Can Swift be used for pre-training visual models?
Yes, you can, but you’ll need to adjust the learning rate yourself. See the tutorial document for details.
Q63: Does magetron support using custom functions via --loss_type my_loss like in Swift?
Megatron currently requires modifications to the loss_func in the trainer; simpler custom logic will be supported in the future.
Q64: Does the Swift framework support Agentic RL training?
Yes,For details, please refer to Multiple Rounds of Training.
Q65: How can I train Qwen3-Omni on ROCm/MI300X using megatron-swift?
You can refer to this best practice.
Inference
Swift supports inference via Python scripts, command line, and UI interfaces. For details, see Inference and Deployment.
Q1: How to set up a model for SWIFT inference?
For models trained with all parameters, models merged after LoRA training, or models downloaded from Model Hub, set the command-line argument
--model <model/id/or/path>.For models trained with LoRA but not merged, specify the base model path with
--model <model/id/or/path>and set--adapters <path/to/adapter>.
Q2: How does SWIFT use datasets for inference? Where are the inference results stored?
Specify the dataset using
--val_dataset <path/to/val_dataset>. If you want to perform inference on the validation set split during training, set the argument--load_data_args true.Set the path to save the inference results using
--result_path <your/path>. The path will be printed in the logs. See the documentation Command Line Parameters Documentation.To retain additional fields other than messages in the inference dataset, set
--remove_unused_columns false.
Q3: How to set up batch inference in SWIFT?
If infer_backend is transformers, set the command-line parameter --max_batch_size 16. Note that this parameter sets the batch size per card, not globally. Or refer to the demo.
Q4: How to set up streaming inference in SWIFT?
Use --stream true. The inference results will be written to a JSONL file line by line.
Note:
Streaming inference does not support DDP.
Q7: How to set system_prompt to empty? The command line does not set the system parameter, but it adds the default system.
Explicitly set --system ''.
Q8: How to compute metrics like ACC/ROUGE during inference?
Use --metric. For specific details, search for this parameter in Command Line Parameter Document.
Q9: During model inference, which parameter should be set to continue generation from a specific prefix?
Use the --response_prefix parameter.
Q10: The ‘answer’ in my data already contains part of the prompt. How should I modify the inference to complete the ‘answer’?
{"messages": [{"role": "system", "content": "<system>"}, {"role": "user", "content": "<query1>"}, {"role": "assistant", "content": "answer1, "}]}
This is supported in Swift versions 3.0 and later. Refer to examples/infer/demo_agent.
Q11: During multimodal model inference, how can I limit the maximum number of pixels to reduce GPU memory usage?
Set the command-line argument --max_pixels xxx, the environment variable MAX_PIXELS=xxx, or the specific model argument --model_kwargs '{"max_pixels": xxx}'. The environment variable only affects the models specified in the documentation. For details, see the documentation on Specific Model Arguments.
Q12: How to output the probability value logprobs parameter in SWIFT inference?
Command line inference setting: --logprobs true; Python script inference setting:
request_config = RequestConfig(..., logprobs=True, top_logprobs=2)
See test_logprobs.py for details.
Q14: Issues with inconsistent inference results between Transformers, vLLM, Ollama, etc.
Swift’s templates are aligned with those of Transformers. Check if the inference parameters are consistent. Additionally, there are differences between VllmEngine and TransformersEngine.
Q15: Inference for embedding/reranker models
Q16: When using a Python script for inference, how can I use the CPU?
Set the environment variable: os.environ['CUDA_VISIBLE_DEVICES'] = '-1'.
Q17: Does the swift infer command support multi-machine inference?
If the model can fit on a single node, you can orchestrate it using Kubernetes. If the model does not fit on a single node, multi-machine inference is not supported.
Q18: Does Swift support batch sampling?
This script allows for multi-process sampling of the dataset.
Q19: Special Model Dependency Version Issues
Qwen2-Audio inference results are corrupted; please use transformers 4.48.
LoRA trained with transformers 4.55.2 cannot be loaded with versions lower than 4.52. See issue#5440 for details.
Swift is compatible with different versions of qwen-vl-utils; switching this dependency version is not required when using qwen2.5-vl and qwen3-vl models.
Q20: safetensors_rust.SafetensorError: Error while deserializing header:MetadataIncompleteBuffer
Model weights are corrupted.
Q21: vLLM error message:
ValueError: the decoder prompt contains a(n) video item with length 16758, which exceeds the pre-allocated encoder cache size 16384. Please reduce the input size or increase the encoder cache size by setting --limit-mm-per-prompt at startup.
This is usually caused by an excessively long multimodal input, exceeding the pre-allocated encoder cache size of vLLM. The encoder cache size can be adjusted using --limit_mm_per_prompt; another possible solution is to pass the following in the Swift CLI:
--vllm_engine_kwargs '{"max_num_batched_tokens": 20000}'
This increases max_num_batched_tokens, indirectly affecting the encoder cache size allocation.
Export
Q2: When quantizing a model using SWIFT, the model may not fit on a single GPU.
Try setting --device_map cpu; or load the model across multiple GPUs and quantize on a single GPU.
Q3: Using Swift export to perform GPTQ int4 quantization on a qwen2.5 72B model, with the default max model length of 32768, and the provided calibration dataset containing 128 samples, but an error occurred during quantization. The error log is as follows:
factorization could not be completed because the input is not positive-definite (the leading minor of order 18145 is not pisitive-definite)
This is due to the Hessian matrix being non-positive definite. Try using a different dataset.
Q4: When exporting in Swift, can the custom template_type be permanently changed?
No, it won’t be modified. Templates in Swift are defined internally by Swift and are not saved using Jinja.
Q5: Can a trained model be directly converted to GGFU format?
Currently, only ModelFile is supported for export. See the Command Line Parameters Documentation for details on export parameters.
Deployment
Q1: How to set up the model for SWIFT deployment?
For a model trained with full parameters, a model merged after LoRA training, or a model downloaded from model hub, set the command line parameter
--model <model/id/or/path>.For unmerged models after LoRA training,
--modelmodel/id/or/path>specifies the base model path and sets--adapters <path/to/adapter>at the same time.
Q2: How does SWIFT deploy multiple cards?
See Examples for details. If it is a transformers engine, it does not support DDP and cannot be deployed with multiple cards. In addition, heterogeneous deployment is not supported, such as different models of graphics cards, different storage ratios for each graphics card, etc.
Q3: Can I select one operation by specifying the system prompt through the –system parameter and adding system prompt and template before each data in the data set? Do these methods have the same priority for the model?
System priority: The default in the data set>command line>template.
Q6: How to set up streaming generation for models deployed by SWIFT?
It is controlled by the client. For details, please see examples/deploy/client.
Q7: How does SWIFT deployment output the probability of token?
First, the server needs to set --logprobs true, and secondly, the client needs to pass the following parameters:
request_config = RequestConfig(..., logprobs=True, top_logprobs=2)
Q9: How to output multiple results at one time?
Pass in the parameter n in RequestConfig, as shown below:
response = client.infer([request], request_config=RequestConfig(
n=3, # Generate 3 items
temperature=0.8, # Needs randomness to produce different results
))
# response contains 3 different answers
Q10: There is a difference between specifying –infer_backend vllm and directly using vllm to deploy inference results.
The inference results are quite different, possibly because the templates are not aligned.
The inference speed varies greatly, possibly because the image resolution is inconsistent.
SWIFT uses the V1 engine by default, and the switch can be controlled through the environment variable
VLLM_USE_V1=1.
Q12: Why can’t I use chat.completions but must use completions after the Qwen2-7B base model is deployed?
The base model has not been trained in conversation format, and it does not recognize chat special tokens such as <|im_start|>user<|im_end|>. The SWIFT framework has done the processing, and the base model can also use client.chat.completions.create, but this is a compatible behavior. In essence, messages are spelled into plain text for continuation.
Evaluation
The eval capability of ms-swift uses the magic community evaluation framework EvalScope. For complex capabilities, please use the EvalScope framework directly.
Q1: What evaluation datasets does Swift support? And how can I use a custom evaluation dataset?
For details on using the standard evaluation set and user-defined evaluation sets, please refer to the Evaluation Documentation.
Q2: After manually downloading an officially supported evaluation dataset, can swift eval be configured to evaluate using a local path?
For offline evaluation, please refer to the EvalScope documentation’s Quick Start.
Q3: The model, after fine-tuning with eval, always stops at a fixed percentage, but the VLLM service continues to run normally.
Client requests exceed the default timeout, and the connection is dropped. You can set the SWIFT_TIMEOUT environment variable to -1 to disable timeout-based disconnections.
Q4: Can the number of data items in the dataset be controlled during evaluation?
The configuration parameter --eval_limit controls the number of data items per subset. For example, if MMLU has more than 50 subsets, and each subset has a limit of 10 data items, the total number of data items is over 500.
Q5: The model generates a maximum of 1024 tokens before stopping. How can this be modified? Trying to set --max_new_tokens to 5000 doesn’t work.
--max_new_tokens is an inference parameter, not an evaluation parameter. The generation length during evaluation is controlled by --eval_generation_config, which requires setting max_new_tokens within this parameter.
--eval_generation_config '{"max_new_tokens": 5000}'
Q6: Doesn’t --eval_backend OpenCompass support custom datasets? The error is reported as follows:
ValueError: eval_dataset: /mnt/workspace/data.jsonl is not supported.
eval_backend: OpenCompass supported datasets: ['C3', 'summedits', 'WiC', 'csl', 'lambada', 'mbpp', 'hellaswag', 'ARC_e', 'math', 'nq', 'race', 'MultiRC', 'cmb', 'ceval', 'GaokaoBench', 'mmlu', 'winogrande', 'tnews', 'triviaqa', 'CB', 'cluewsc', 'humaneval', 'AX_g', 'DRCD', 'RTE', 'ocnli_fc', 'gsm8k', 'obqa', 'ReCoRD', 'Xsum', 'ocnli', 'WSC', 'siqa', 'agieval', 'piqa', 'cmnli', 'cmmlu', 'eprstmt', 'storycloze', 'AX_b', 'afqmc', 'strategyqa', 'bustm', 'BoolQ', 'COPA', 'ARC_c', 'PMMEval', 'chid', 'CMRC', 'lcsts']
OpenCompass only supports its predefined standard evaluation sets and does not support custom datasets. Custom datasets can be defined using native methods.
Q7: Evalscope can generate reports natively. Do other backends like OpenCompass support this as well?
Currently, only native visualization is supported. Other backends are not yet supported.
Q8: Ifeval evaluation error:
[Errno 20] Not a directory: '/root/nltk_data/tokenizers/punkt_tab.zip/punkt_tab/english/collocations.tab'
You need to unzip unzip /path/to/nltk_data/tokenizers/punkt_tab.zip.
Q9: How do I specify the offline dataset path for eval_backend=’OpenCompass’?
See the Data Preparation Tutorial, download the dataset, and unzip it. No need to specify dataset-args. Simply place the dataset folder (i.e., the data folder) in the current working directory, and OpenCompass will automatically recognize it.
Q10: Error:
unzip: cannot find or open /root/nltk_data/tokenizers/punkt_tab.zip, /root/nltk_data/tokenizers/punkt_tab.zip.zip or /root/nltk_data/tokenizers/punkt_tab.zip.ZIP
This indicates a failure to download nltk dependencies. Manually download punkt_tab.zip and extract it to ~/nltk_data/tokenizers.
Q11: Can LLM be specified as the judge? How should the parameters be passed in?
Supported. Parameter passing is as follows:
--extra_eval_args '{"judge-model-args": {"api_key": "xxx", "api_url": "http://xxx/v1", "model_id": "qwen-72b"}}'
Q12: When executing eval, uneven memory allocation across multiple GPUs occurred, with the following error:
NPROC_PER_NODE=8
ASCEND_RT_VISIBLE_DEVICES=0,1,2,3,4,5,6,7\ MAX_PIXELS=802816\ swift eval\
--model "$MODEL_PATH” \$EXTRA_ARGS \
--eval_backend Native \ --infer_backend transformers\ --device_map auto \
--eval_limit"$EVAL_LIMIT"\ --eval_dataset general_qa\
--dataset_args "{\"general_qa\": {\"local_path\": \"${DATA_PATH}\", \"subset_list\": [\"${SUBSET_NAME}\"]}}" \ --host 127.0.0.1\> "$LOG_FILE" 2>&1
swift eval does not support DDP startup.
Q13: Where can I see what additional fields are included in the query besides the question during Swift evaluation?
The simplest way is to look at the input field in the output reviews file; it’s the Markdown format of the content input to the model.
If the backend is OpenCompass, these outputs won’t be available, and you’ll need to use a native backend.
Q14: When installing evalscope using pip, it keeps getting stuck at “preparing metadata(pyproject.toml)”.
This process involves evaluating dependencies during installation, which may be relatively slow.