Spaces:
Sleeping
Sleeping
from transformers import pipeline | |
import streamlit as st | |
model_name = "FPRT/bert-fine-tuned-stepkids-classification" | |
pipe = pipeline(model=model_name) | |
def main(): | |
st.title("Hugging Face Model Demo") | |
# Create an input text box | |
input_text = st.text_input("Enter your text", "") | |
# Create a button to trigger model inference | |
if st.button("Analyze"): | |
# Perform inference using the loaded model | |
result = pipe(input_text) | |
st.write("Prediction:", result[0]['label'], "| Score:", result[0]['score']) | |
if __name__ == "__main__": | |
main() |