Skip to content

fix: define TransformersCompletionCreateParamsStreaming inside conditional to avoid NameError when serve is unavailable (closes #46657)#46671

Closed
botbikamordehai2-sketch wants to merge 1 commit into
huggingface:mainfrom
botbikamordehai2-sketch:fix/issue-46657-1781536636
Closed

fix: define TransformersCompletionCreateParamsStreaming inside conditional to avoid NameError when serve is unavailable (closes #46657)#46671
botbikamordehai2-sketch wants to merge 1 commit into
huggingface:mainfrom
botbikamordehai2-sketch:fix/issue-46657-1781536636

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

When is_serve_available() returns False (e.g., missing OpenAI package), the class CompletionCreateParamsStreaming is never imported, causing a NameError at the definition of TransformersCompletionCreateParamsStreaming.

Fix

Move the definition of TransformersCompletionCreateParamsStreaming inside the same conditional block where CompletionCreateParamsStreaming is imported, so it is only defined when the required dependency is available.

Closes #46657

…ional to avoid NameError when serve is unavailable (closes huggingface#46657)
@github-actions

Copy link
Copy Markdown
Contributor

CI Dashboard: View test results in Grafana

@Rocketknight1

Copy link
Copy Markdown
Member

This is unrelated to the linked issue. Your bot is broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Size of tensors mismatch when training object detection model

2 participants