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

cannot import name 'Conversation' from 'transformers' #32096

Closed
4 tasks
amathews-amd opened this issue Jul 19, 2024 · 4 comments · Fixed by #32099
Closed
4 tasks

cannot import name 'Conversation' from 'transformers' #32096

amathews-amd opened this issue Jul 19, 2024 · 4 comments · Fixed by #32099
Labels
bug Chat Template Core: Pipeline Internals of the library; Pipeline.

Comments

@amathews-amd
Copy link

amathews-amd commented Jul 19, 2024

System Info

transformers tip of tree

Who can help?

@amyeroberts

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

pytest tests/ -m "not not_device_test" -p no:cacheprovider

______ ERROR collecting tests/pipelines/test_pipelines_conversational.py _______
ImportError while importing test module '/workspace/transformers/tests/pipelines/test_pipelines_conversational.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/conda/envs/py_3.9/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/pipelines/test_pipelines_conversational.py:18: in <module>
    from transformers import (
E   ImportError: cannot import name 'Conversation' from 'transformers' (/workspace/transformers/src/transformers/__init__.py)

Expected behavior

pytest collection succeeds with no error

@amyeroberts
Copy link
Collaborator

Thanks for reporting! I've opened a PR which should resolve this

@samgermain
Copy link

According to that PR

Conversational pipeline has been fully deprecated

has it been replaced with anything?

@LysandreJik
Copy link
Member

cc @Rocketknight1 on @samgermain's question above!

@LysandreJik LysandreJik added Core: Pipeline Internals of the library; Pipeline. Chat Template labels Sep 9, 2024
@Rocketknight1
Copy link
Member

@samgermain yes, you can pass chats to the TextGenerationPipeline instead! See the docs here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Chat Template Core: Pipeline Internals of the library; Pipeline.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants