You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on integrating ChatUniVi into a Sanic web application and encountered an unexpected error during runtime. The error occurs when attempting to load a pretrained model using the load_pretrained_model function from the ChatUniVi package. The traceback provided below outlines the sequence of events leading to the error.
Error Traceback
Traceback (most recent call last):
File "C:\Users\Ervin\Documents\Chat-UniVi\main.py", line 22, in <module>
tokenizer, _, _, _ = load_pretrained_model(model_path, None, model_name)
File "C:\Users\Ervin\Documents\Chat-UniVi\ChatUniVi\model\builder.py", line 75, in load_pretrained_model
model = AutoModelForCausalLM.from_pretrained(model_path, low_cpu_mem_usage=True, **kwargs)
File "C:\Users\Ervin\anaconda3\envs\chatunivi\lib\site-packages\transformers\models\auto\auto_factory.py", line 563, in from_pretrained
return model_class.from_pretrained(
File "C:\Users\Ervin\anaconda3\envs\chatunivi\lib\site-packages\transformers\modeling_utils.py", line 3685, in from_pretrained
max_memory = get_balanced_memory(
File "C:\Users\Ervin\anaconda3\envs\chatunivi\lib\site-packages\accelerate\utils\modeling.py", line 753, in get_balanced_memory
per_gpu = module_sizes[""] // (num_devices - 1 if low_zero else num_devices)
ZeroDivisionError: integer division or modulo by zero
Steps to Reproduce
Ensure all dependencies are installed and up-to-date.
Set the model_path and model_name variables in main.py.
Run the application. Error immediately appears
Expected Behavior
The application should successfully load the pretrained model and serve it through the defined endpoints (/img and /vid) without throwing errors.
Problem Description
I'm currently working on integrating ChatUniVi into a Sanic web application and encountered an unexpected error during runtime. The error occurs when attempting to load a pretrained model using the load_pretrained_model function from the ChatUniVi package. The traceback provided below outlines the sequence of events leading to the error.
Error Traceback
Steps to Reproduce
model_path
andmodel_name
variables in main.py.Expected Behavior
The application should successfully load the pretrained model and serve it through the defined endpoints (/img and /vid) without throwing errors.
Environment
Python version: 3.10.4
Sanic version: 24.6.0
Operating System: Windows 10
Requested Action
Could you please provide guidance on how to resolve this issue? Thank you for your assistance.
main.py
The text was updated successfully, but these errors were encountered: