File size: 579 Bytes
7f8f9cc
fa93b6f
 
7f8f9cc
 
fa93b6f
7f8f9cc
 
fa93b6f
7f8f9cc
 
c3da8c6
7f8f9cc
 
 
 
 
80e06e8
7f8f9cc
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()