File size: 692 Bytes
6b07091
7b9da80
6b07091
7b9da80
 
 
44c9b16
 
 
7b9da80
 
a79388a
44c9b16
 
 
7b9da80
a79388a
 
 
 
 
7b9da80
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit as st
from transformers import pipeline

def main():
    st.title("Hello Streamlit App")
    st.write("Welcome to the Hello Streamlit app!")  
    name = st.text_input("Enter your name:")
    button = st.button("Submit", type="primary", key="1")    
    if button:
        st.write(f"Hello, {name}! Nice to meet you!")

        #Load default class model
        pipe = pipeline("text-classification")        
        results = pipe(name)
        st.write(results)

        #Load custom model from user/repoName
        pipe2 = pipeline(model="FacebookAI/roberta-large-mnli")
        results2 = pipe2(name)
        st.write(results2)

if __name__ == "__main__":
    main()