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

Huggingface classifier support #3571

Merged
merged 5 commits into from
May 11, 2024
Merged

Conversation

krrishdholakia
Copy link
Contributor

@krrishdholakia krrishdholakia commented May 10, 2024

Title

Support Huggingface Classifier Models

from litellm import completion 

response = completion(
            model="huggingface/shahrukhx01/question-vs-statement-classifier",
            messages=[{"role": "user", "content": "I like you"}],
            hf_task="text-classification" # 👈 New HF Task param 
)

Relevant issues

Closes #3568

Type

🆕 New Feature

Changes

  • huggingface_restapi.py - introduces support for hf 'text-classification' calls

Testing

  • test_completion.py

Pre-Submission Checklist (optional but appreciated):

  • I have included relevant documentation updates (stored in /docs/my-website)

OS Tests (optional but appreciated):

  • Tested on MacOS

Copy link

vercel bot commented May 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 10, 2024 10:50pm

litellm/tests/test_completion.py Dismissed Show dismissed Hide dismissed
litellm/tests/test_completion.py Dismissed Show dismissed Hide dismissed
@krrishdholakia krrishdholakia merged commit 1aa567f into main May 11, 2024
8 checks passed
@krrishdholakia krrishdholakia deleted the litellm_hf_classifier_support branch May 11, 2024 00:54
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

Successfully merging this pull request may close these issues.

[Feature]: Support hf classifier models
1 participant