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

ValueError: max() arg is an empty sequence #449

Open
brandburner opened this issue Mar 5, 2024 · 0 comments
Open

ValueError: max() arg is an empty sequence #449

brandburner opened this issue Mar 5, 2024 · 0 comments

Comments

@brandburner
Copy link

Just upgraded from 0.6.2 to 0.71 and my script doesn't run anymore. I get the error:

ValueError: max() arg is an empty sequence

This is the function causing the issue:

def classify_content_by_speaker(content):
  doc = nlp(content)
  category = max(doc.cats, key=doc.cats.get)
  speaker = speaker_mapping.get(category, "Unknown Speaker")
  reason = f"Assigned to {speaker} based on LLM classification for category {category}."
  return {'speaker': speaker, 'reason': reason}

Downgrading back to 0.6.2 fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant