Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colab #1

Open
ssugarwh opened this issue Jul 13, 2024 · 1 comment
Open

colab #1

ssugarwh opened this issue Jul 13, 2024 · 1 comment

Comments

@ssugarwh
Copy link

I encountered this problem when running the second cell in colab, how to solve it

NameError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name)
1534 try:
-> 1535 return importlib.import_module("." + module_name, self.name)
1536 except Exception as e:

17 frames
NameError: name 'torch' is not defined

The above exception was the direct cause of the following exception:

RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name)
1535 return importlib.import_module("." + module_name, self.name)
1536 except Exception as e:
-> 1537 raise RuntimeError(
1538 f"Failed to import {self.name}.{module_name} because of the following error (look up to see its"
1539 f" traceback):\n{e}"

RuntimeError: Failed to import transformers.integrations.bitsandbytes because of the following error (look up to see its traceback):
name 'torch' is not defined

@stylellm
Copy link
Owner

I encountered this problem when running the second cell in colab, how to solve it

NameError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name) 1534 try: -> 1535 return importlib.import_module("." + module_name, self.name) 1536 except Exception as e:

17 frames NameError: name 'torch' is not defined

The above exception was the direct cause of the following exception:

RuntimeError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name) 1535 return importlib.import_module("." + module_name, self.name) 1536 except Exception as e: -> 1537 raise RuntimeError( 1538 f"Failed to import {self.name}.{module_name} because of the following error (look up to see its" 1539 f" traceback):\n{e}"

RuntimeError: Failed to import transformers.integrations.bitsandbytes because of the following error (look up to see its traceback): name 'torch' is not defined

Caused by a transformers version problem and solved now. Pull the latest code or restart the colab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants