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

Extend OpenAI finish_reason handling #1985

Prev Previous commit
Next Next commit
Fix typo
soonernotfaster committed May 22, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit c064bda894838d1bc99305ab5977fce995b9de38
2 changes: 1 addition & 1 deletion bertopic/representation/_openai.py
Original file line number Diff line number Diff line change
@@ -227,7 +227,7 @@ def extract_topics(self,
if hasattr(output.message, "content"):
label = output.message.content.strip().replace("topic: ", "")
else:
label = "Incomple output due to token limit being reached"
label = "Incomplete output due to token limit being reached"
elif output.finish_reason == "content_filter":
logger.warn(f"Extracing Topics - Content filtered for doc_ids ({repr_doc_ids})")
soonernotfaster marked this conversation as resolved.
Show resolved Hide resolved
label = "Output content filtered by OpenAI"