Gregoryjr commited on
Commit
b3d7546
·
unverified ·
1 Parent(s): d6fbb90

Update app.py

Browse files

model is customizable

Files changed (1) hide show
  1. app.py +2 -1
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("zero-shot-classification")
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)