neuralmagic / deepsparse

Sparsity-aware deep learning inference runtime for CPUs
https://neuralmagic.com/deepsparse/
Other
2.97k stars 171 forks source link

[Pipeline Refactor] Fix circular import caused by `chat.py` #1470

Closed dsikka closed 8 months ago

dsikka commented 8 months ago

Summary

Example:

This works fine:

from deepsparse.legacy import Pipeline
from deepsparse.transformers.schemas.text_generation_schemas import TextGenerationOutput

Pipeline.create(task="text_generation", ...)

This does not:

from deepsparse.legacy import Pipeline

Pipeline.create(task="text_generation", ...)

Not obvious to me why the first doesn't cause the same issue with a circular import?