Skip to content

Commit

Permalink
Cleanup Python 3.9 (#1250)
Browse files Browse the repository at this point in the history
* Bump transformers to 4.38 to solve security issue.
* Bump scikit-learn to 1.5.1 to address security issue.
* Remove numpy version for Python 3.8
* Unpin tenacity as it is fixed upstream
* Unpin matplotlib version
* Bump mypy Python version to 3.9 and cleanup mypy overrides
* Update poetry.lock

---------

Co-authored-by: Mathijs de Bruin <[email protected]>
  • Loading branch information
EWouters and dokterbob authored Aug 22, 2024
1 parent ce9c992 commit 9d68215
Show file tree
Hide file tree
Showing 3 changed files with 674 additions and 682 deletions.
10 changes: 3 additions & 7 deletions backend/chainlit/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,10 @@ def __post_init__(self) -> None:
if not isinstance(self.figure, Figure):
raise TypeError("figure must be a matplotlib.figure.Figure")

options = {
"dpi": 200,
"bbox_inches": "tight",
"backend": "Agg",
"format": "png",
}
image = BytesIO()
self.figure.savefig(image, **options)
self.figure.savefig(
image, dpi=200, bbox_inches="tight", backend="Agg", format="png"
)
self.content = image.getvalue()

super().__post_init__()
Expand Down
Loading

0 comments on commit 9d68215

Please sign in to comment.