Repository: modelscope/evalscope
Issue: ms-swift 3.0 donot support `get_default_template_type`
Root cause: External Dependency Breakage

Please check https://github.com/modelscope/ms-swift/blob/b2d3ef503ece8642b6ca7ab3862b59e9f2846d47/docs/source_en/Instruction/Frequently-asked-questions.md#q78-does-swift30-not-support-get_default_template_type



Is there any promblem? Could you please describe it in detail?

- ms_swift:  3.2.0.post2
- evalscope: 0.12.0

toolbench.yaml
```
infer_args:
  model_name_or_path: /models/Qwen/QwQ-32B      # absolute path is recommended
  model_type: qwq
  data_path: /data/toolbench_static   # absolute path is recommended
  deploy_type: swift
  max_new_tokens: 4096
  num_infer_samples: null
  output_dir: output_res
eval_args:
  input_path: output_res
  output_path: output_res
```

Got error: 
from swift.llm import (
ImportError: cannot import name 'get_default_template_type' from 'swift.llm' 

downgrade `ms_swift` to  2.x. It works fine. But `ms-swift` 2.x does not support QwQ-32B.

Update `evalscope/third_party/toolbench_static/llm/swift_infer.py`  to the following code (provided by Claude 3.7 Sonnet) :
```
import os
from dataclasses import dataclass
from swift.llm import InferRequest, InferEngine, RequestConfig, PtEngine, get_template

# 设置GPU环境变量
os.environ['CUDA_VISIBLE_DEVICES'] = '0'

@dataclass
class SwiftInferArgs:
    model_id_or_path: str
    model_type: str
    infer_backend: str = 'vllm'  # 可选 'pt', 'vllm', 'lmdeploy'
    max_new_tokens: int = 2048
    temperature: float = 0.1
    max_batch_size: int = 16

class SwiftInfer:

    def __init__(self, args: SwiftInferArgs):
        # infer backend模型初始化
        if args.infer_backend == 'pt':
            self.engine: InferEngine = PtEngine(args.model_id_or_path, max_batch_size=args.max_batch_size)
        elif args.infer_backend == 'vllm':
            from swift.llm import VllmEngine
            self.engine: InferEngine = VllmEngine(args.model_id_or_path, max_model_len=8192)
        elif args.infer_backend == 'lmdeploy':
            from swift.llm import LmdeployEngine
            self.engine: InferEngine = LmdeployEngine(args.model_id_or_path)
        else:
            raise ValueError(f'Unsupported infer_backend: {args.infer_backend}')

        # 基本配置获取 （可选）
        self.request_config = RequestConfig(
            max_tokens=args.max_new_tokens,
            temperature=args.temperature,
            stream=False  # 可以透传参数改为True进行流式推理
        )

    def predict(self, system: str, query: str, history: list):
        # Swift 3.0标准接口中，消息传入的格式是：
        # messages: [{"role": "system", "content": "<SYSTEM_PROMPT>"},
        #            {"role": "user", "content": "用户问题内容"},
        #            {"role": "assistant", "content": "助手回答内容"}, ...]

        messages = []
        if system.strip():
            messages.append({'role': 'system', 'content': system})

        # 将历史对话拼接进message中
        for qa_pair in history:
            # 假定 history 中每个元素形如 ("user input", "model response")，请根据你的数据格式进行调整。
            user_answer, model_response = qa_pair
            messages.append({'role': 'user', 'content': user_answer})
            messages.append({'role': 'assistant', 'content': model_response})

        # 添加本次用户问题
        messages.append({'role': 'user', 'content': query})

        infer_request = InferRequest(messages=messages)

        # 进行推理
        response = self.engine.infer([infer_request], self.request_config)

        # 提取模型返回的文本结果（假设非stream模式）
        result_text = response[0].choices[0].message.content.strip()

        return result_text
```

Then it works fine.

Thank you for your feedback. We will fix this issue.

> 感谢你的反馈！该问题已修复，我们将关闭此问题。如果您有任何疑问，请随时重新打开它。如果EvalScope对您有所帮助，欢迎给我们点个STAR以示支持，谢谢！