Spaces:
Sleeping
Sleeping
Kingston Yip
commited on
Commit
·
d1320a7
1
Parent(s):
5e6cddb
YEEEE
Browse files- app.py +8 -2
- requirements.txt +0 -1
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import AutoModelForSequenceClassification, pipeline, AutoToken
|
|
4 |
import pandas as pd
|
5 |
import comments
|
6 |
from random import randin
|
7 |
-
import
|
8 |
|
9 |
|
10 |
def predict_cyberbullying_probability(sentence, tokenizer, model):
|
@@ -89,7 +89,13 @@ with st.form("my_form"):
|
|
89 |
submitted = True
|
90 |
|
91 |
if kanye:
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
st.write(tweet)
|
94 |
|
95 |
if submitted:
|
|
|
4 |
import pandas as pd
|
5 |
import comments
|
6 |
from random import randin
|
7 |
+
import requests
|
8 |
|
9 |
|
10 |
def predict_cyberbullying_probability(sentence, tokenizer, model):
|
|
|
89 |
submitted = True
|
90 |
|
91 |
if kanye:
|
92 |
+
response = requests.get('https://api.kanye.rest/')
|
93 |
+
if response.status_code == 200:
|
94 |
+
data = response.json()
|
95 |
+
tweet = data['quote']
|
96 |
+
print(f'Kanye says: "{tweet}"')
|
97 |
+
else:
|
98 |
+
print(f'Error {response.status_code}: Failed to retrieve Kanye quote')
|
99 |
st.write(tweet)
|
100 |
|
101 |
if submitted:
|
requirements.txt
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
transformers
|
2 |
torch
|
3 |
-
kanye
|
4 |
pandas
|
|
|
1 |
transformers
|
2 |
torch
|
|
|
3 |
pandas
|