File size: 530 Bytes
df4e81e
398e011
df4e81e
398e011
df4e81e
398e011
 
df4e81e
398e011
 
df4e81e
398e011
 
 
 
 
df4e81e
398e011
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st
from transformers import pipeline

model = pipeline("tiiuae/falcon-7b-instruct")

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 = model(input_text)
        st.write("Prediction:", result[0]['label'], "| Score:", result[0]['score'])

if __name__ == "__main__":
    main()