Getting an Error while deploying xgb model

AttributeError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

Traceback:

File "/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^File "/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec
    exec(code, module.__dict__)File "/mount/src/hr-analytics---project/model.py", line 163, in <module>
    main()File "/mount/src/hr-analytics---project/model.py", line 157, in main
    model = pickle.load(open('test.pkl','rb'))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

does test.pkl exist in your repo’s root?

@SiddhantSadangi
yes test.pkl existed in repo’s root.

Please share the full traceback and link to the repo

Here is the link for github repo,
GitHub - VivekGangurde/HR-Analytics---Project.

The source code for deployment on streamlit file is also available there-“model.py”.
Is there an issue with ML model or something else?

Please post the complete traceback from next time onwards (not only here, but in all support forums).

In your case, this is the error

AttributeError: Can't get attribute 'XGBoostLabelEncoder' on <module 'xgboost.compat' from 'C:\\Users\\siddh\\python_envs\\py310\\lib\\site-packages\\xgboost\\compat.py'>
Traceback:
File "C:\Users\siddh\python_envs\py310\lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
File "C:\Users\siddh\python_envs\py310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 590, in code_to_exec
    exec(code, module.__dict__)
File "C:\Users\siddh\OneDrive\Desktop\HR-Analytics---Project\model.py", line 163, in <module>
    main()
File "C:\Users\siddh\OneDrive\Desktop\HR-Analytics---Project\model.py", line 157, in main
    model = pickle.load(open('test.pkl','rb'))

A quick Google search this this as the first result: module ‘xgboost.compat’ has no attribute ‘XGBoostLabelEncoder’ Error · Issue #6209 · dmlc/xgboost (github.com)