joko333's picture
Add transformers import to app.py for model integration
e0c48fb
raw
history blame
421 Bytes
import streamlit as st
import transformers
from transformers import pipeline
st.title('My first app')
x = st.slider('Select a value')
st.write(x, 'squared is', x * x)
classifier = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")
# Example input text
input_text = "I love using Hugging Face models!"
# Get the classification result
result = classifier(input_text)
print(result)