import streamlit as st from transformers import pipeline from transformers import AutoTokenizer as AT, AutoModelForSequenceClassification as AFSC modName = "madhurjindal/autonlp-Gibberish-Detector-492513457" # Gibberish Detection Model from HuggingFace mod = AFSC.from_pretrained(modName) TKR = AT.from_pretrained(modName) st.title("Gibberish Detector") user_input = str(st.text_input("Enter some words", "pasghetti")) classifier = pipeline("sentiment-analysis", model=mod, tokenizer=TKR) # result = classifier(["This is a sample text made by Sean Ramirez.", "This is another sample text."]) # leftover from initial testing if user_input is not None: predicts = pipeline("sentiment-analysis", model=mod, tokenizer=TKR) st.markdown("## Probabilities") st.markdown(str(predicts))