Gregoryjr
commited on
Update app.py
Browse filesmodel is customizable
app.py
CHANGED
@@ -2,9 +2,10 @@ import streamlit as st
|
|
2 |
from transformers import pipeline
|
3 |
st.title("Milestone #2")
|
4 |
text = st.text_input("write a statement")
|
|
|
5 |
con = st.button("submit")
|
6 |
if con:
|
7 |
-
classifier = pipeline(
|
8 |
res = classifier(text, candidate_labels= ["offensive"],)
|
9 |
print(res)
|
10 |
st.write(res)
|
|
|
2 |
from transformers import pipeline
|
3 |
st.title("Milestone #2")
|
4 |
text = st.text_input("write a statement")
|
5 |
+
model = st.text_input("pick a model to check the the above statement is offensive")
|
6 |
con = st.button("submit")
|
7 |
if con:
|
8 |
+
classifier = pipeline(model)
|
9 |
res = classifier(text, candidate_labels= ["offensive"],)
|
10 |
print(res)
|
11 |
st.write(res)
|