Spaces:
Sleeping
Sleeping
Kingston Yip
commited on
Commit
·
5c0aa0b
1
Parent(s):
67e1b13
updates
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipe
|
|
6 |
st.title("Toxic Tweets Analyzer")
|
7 |
image = "kanye_tweet.jpg"
|
8 |
st.image(image, use_column_width=True)
|
|
|
9 |
|
10 |
|
11 |
with st.form("my_form"):
|
@@ -36,9 +37,8 @@ with st.form("my_form"):
|
|
36 |
|
37 |
if out[0]["label"] == "POSITIVE" or out[0]["label"] == "POS":
|
38 |
# st.balloons()
|
39 |
-
|
40 |
-
|
41 |
-
# response = generator(prompt)
|
42 |
st.success("nice")
|
43 |
else:
|
44 |
# prompt = f"{basic_prompt} + \n\nThe user wrote a tweet that says: {tweet}, tell them on how terrible of a person they are! Remember try to be as cringe and awkard as possible!"
|
|
|
6 |
st.title("Toxic Tweets Analyzer")
|
7 |
image = "kanye_tweet.jpg"
|
8 |
st.image(image, use_column_width=True)
|
9 |
+
generator = pipeline('text-generation', model='EleutherAI/gpt-neo-1.3B')
|
10 |
|
11 |
|
12 |
with st.form("my_form"):
|
|
|
37 |
|
38 |
if out[0]["label"] == "POSITIVE" or out[0]["label"] == "POS":
|
39 |
# st.balloons()
|
40 |
+
prompt = f"{basic_prompt} + \n\nThe user wrote a tweet that says: {tweet}, compliment them on how nice of a person they are! Remember try to be as cringe and awkard as possible!"
|
41 |
+
response = generator(prompt)
|
|
|
42 |
st.success("nice")
|
43 |
else:
|
44 |
# prompt = f"{basic_prompt} + \n\nThe user wrote a tweet that says: {tweet}, tell them on how terrible of a person they are! Remember try to be as cringe and awkard as possible!"
|