Spaces:
Sleeping
Sleeping
JKJanosko
commited on
Commit
•
49a734a
1
Parent(s):
e904477
fixed directories in app.py
Browse files
app.py
CHANGED
@@ -128,7 +128,7 @@ def main():
|
|
128 |
tokenizer=AutoTokenizer.from_pretrained("roberta-base")
|
129 |
toxic_comments_dataset=toxicity_dataset("data/train.csv",tokenizer,attributes)
|
130 |
|
131 |
-
toxicity_data_module=Toxcity_Data_Module("data/train.csv","data/test.csv",attributes)
|
132 |
toxicity_data_module.setup()
|
133 |
dataloader=toxicity_data_module.train_dataloader()
|
134 |
|
@@ -143,7 +143,7 @@ def main():
|
|
143 |
'n_epochs':1
|
144 |
}
|
145 |
|
146 |
-
toxicity_data_module=Toxcity_Data_Module("data/train.csv","data/reduced_test.csv",attributes,batch_size=config['bs'])
|
147 |
toxicity_data_module.setup()
|
148 |
|
149 |
|
@@ -163,7 +163,7 @@ def main():
|
|
163 |
logits = predict_raw_comments(model,toxicity_data_module,trainer=trainer)
|
164 |
torch_logits = torch.from_numpy(logits)
|
165 |
probabilities = F.softmax(torch_logits, dim = -1).numpy()
|
166 |
-
inputs=pd.read_csv("data/reduced_test.csv")
|
167 |
data=[]
|
168 |
#print(inputs["comment_text"][0]," ",probabilities)
|
169 |
for i in range(len(probabilities)):
|
@@ -185,4 +185,4 @@ def main():
|
|
185 |
|
186 |
|
187 |
if __name__ == '__main__' :
|
188 |
-
main()
|
|
|
128 |
tokenizer=AutoTokenizer.from_pretrained("roberta-base")
|
129 |
toxic_comments_dataset=toxicity_dataset("data/train.csv",tokenizer,attributes)
|
130 |
|
131 |
+
toxicity_data_module=Toxcity_Data_Module("AppDirectory/data/train.csv","AppDirectory/data/test.csv",attributes)
|
132 |
toxicity_data_module.setup()
|
133 |
dataloader=toxicity_data_module.train_dataloader()
|
134 |
|
|
|
143 |
'n_epochs':1
|
144 |
}
|
145 |
|
146 |
+
toxicity_data_module=Toxcity_Data_Module("AppDirectory/data/train.csv","AppDirectory/data/reduced_test.csv",attributes,batch_size=config['bs'])
|
147 |
toxicity_data_module.setup()
|
148 |
|
149 |
|
|
|
163 |
logits = predict_raw_comments(model,toxicity_data_module,trainer=trainer)
|
164 |
torch_logits = torch.from_numpy(logits)
|
165 |
probabilities = F.softmax(torch_logits, dim = -1).numpy()
|
166 |
+
inputs=pd.read_csv("AppDirectory/data/reduced_test.csv")
|
167 |
data=[]
|
168 |
#print(inputs["comment_text"][0]," ",probabilities)
|
169 |
for i in range(len(probabilities)):
|
|
|
185 |
|
186 |
|
187 |
if __name__ == '__main__' :
|
188 |
+
main()
|