Skip to content

Instantly share code, notes, and snippets.

@hadifar
Created August 19, 2023 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hadifar/b0761d78141ee911054c17a649e9b775 to your computer and use it in GitHub Desktop.
Save hadifar/b0761d78141ee911054c17a649e9b775 to your computer and use it in GitHub Desktop.
from transformers import pipeline
classifier = pipeline("text-classification", model="hadifar/xxx")
try:
while True:
user_input = input("Enter a string (Press Ctrl+C to stop): ")
if user_input:
res = classifier([user_input])
print(res)
except KeyboardInterrupt:
print("\nProgram stopped by the user.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment