binary-husky/gpt_academic · critical · RuntimeError

不能正常加载jittorllms的参数!

Error message

不能正常加载jittorllms的参数!

What it means

Same loader failure as the llama variant but for PanGu-Alpha: get_model(types.SimpleNamespace(model='pangualpha')) raised inside the JittorLLMs loader subprocess, and the bare except converts it to RuntimeError('不能正常加载jittorllms的参数!') after notifying the parent. The underlying cause is swallowed.

Source

Thrown at request_llms/bridge_jittorllms_pangualpha.py:65

            root_dir_assume = os.path.abspath(os.path.dirname(__file__) +  '/..')
            os.chdir(root_dir_assume + '/request_llms/jittorllms')
            sys.path.append(root_dir_assume + '/request_llms/jittorllms')
        validate_path() # validate path so you can run from base directory

        def load_model():
            import types
            try:
                if self.jittorllms_model is None:
                    device = get_conf('LOCAL_MODEL_DEVICE')
                    from .jittorllms.models import get_model
                    # available_models = ["chatglm", "pangualpha", "llama", "chatrwkv"]
                    args_dict = {'model': 'pangualpha'}
                    print('self.jittorllms_model = get_model(types.SimpleNamespace(**args_dict))')
                    self.jittorllms_model = get_model(types.SimpleNamespace(**args_dict))
                    print('done get model')
            except:
                self.child.send('[Local Message] Call jittorllms fail 不能正常加载jittorllms的参数。')
                raise RuntimeError("不能正常加载jittorllms的参数!")
        print('load_model')
        load_model()

        # 进入任务等待状态
        print('进入任务等待状态')
        while True:
            # 进入任务等待状态
            kwargs = self.child.recv()
            query = kwargs['query']
            history = kwargs['history']
            # 是否重置
            if len(self.local_history) > 0 and len(history)==0:
                print('触发重置')
                self.jittorllms_model.reset()
            self.local_history.append(query)

            print('收到消息,开始请求')
            try:

View on GitHub (pinned to d6bde0fa54)

Solutions

  1. Reproduce outside the loader: `python -c "from request_llms.jittorllms.models import get_model; import types; get_model(types.SimpleNamespace(model='pangualpha'))"` to expose the real traceback.
  2. Install/fetch the jittorllms submodule and let the PanGu-Alpha weights download fully (check disk space and network).
  3. Verify LOCAL_MODEL_DEVICE and GPU memory fit the model; try cpu as a smoke test.
  4. Consider a maintained local-model bridge — JittorLLMs/PanGu support is legacy.
Defensive patterns

Strategy: validation

Validate before calling

def jittorllms_available(model: str) -> bool:
    try:
        from request_llms.jittorllms.models import get_model  # noqa
        return True
    except Exception:
        return False

Try / catch

try:
    handle = GetGLMHandle()
except RuntimeError as e:
    if 'jittorllms' in str(e):
        log.error('pangualpha load failed: %s', e)

Prevention

When it happens

Trigger: First load of the local pangualpha model: missing jittorllms submodule/deps, PanGu-Alpha checkpoint download failure, Jittor CUDA init failure, or wrong LOCAL_MODEL_DEVICE.

Common situations: Fresh environment without jittorllms assets, offline machine that cannot fetch weights, Jittor/driver incompatibility, insufficient GPU memory for PanGu-Alpha.

Related errors


AI-assisted analysis of binary-husky/gpt_academic@d6bde0fa54 (2026-08-14). Data as JSON: /api/errors/8fc52c5d5dac3f45. Report an issue: GitHub.