Propvia commited on
Commit
4e74751
·
1 Parent(s): 72724ba

swapping spam

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,17 +1,17 @@
1
  from fastapi import FastAPI
2
  from fastapi.middleware.cors import CORSMiddleware
3
  from pydantic import BaseModel
4
- from transformers import pipeline
5
  import os
6
 
7
-
8
  os.environ["HF_HOME"] = "/tmp"
9
 
10
- SPAM_MODEL = "valurank/distilroberta-spam-comments-detection"
11
  TOXIC_MODEL = "s-nlp/roberta_toxicity_classifier"
12
  SENTIMENT_MODEL = "nlptown/bert-base-multilingual-uncased-sentiment"
13
  NSFW_MODEL = "michellejieli/NSFW_text_classifier"
14
  HATE_MODEL = "facebook/roberta-hate-speech-dynabench-r4-target"
 
15
 
16
  spam = pipeline("text-classification", model=SPAM_MODEL)
17
 
@@ -23,6 +23,8 @@ nsfw = pipeline("text-classification", model = NSFW_MODEL)
23
 
24
  hate = pipeline("text-classification", model = HATE_MODEL)
25
 
 
 
26
 
27
  app = FastAPI()
28
 
 
1
  from fastapi import FastAPI
2
  from fastapi.middleware.cors import CORSMiddleware
3
  from pydantic import BaseModel
4
+ from transformers.pipelines import pipeline
5
  import os
6
 
 
7
  os.environ["HF_HOME"] = "/tmp"
8
 
9
+ SPAM_MODEL = "cjell/spam-detector-roberta "
10
  TOXIC_MODEL = "s-nlp/roberta_toxicity_classifier"
11
  SENTIMENT_MODEL = "nlptown/bert-base-multilingual-uncased-sentiment"
12
  NSFW_MODEL = "michellejieli/NSFW_text_classifier"
13
  HATE_MODEL = "facebook/roberta-hate-speech-dynabench-r4-target"
14
+ IMAGE_MODEL = "Falconsai/nsfw_image_detection"
15
 
16
  spam = pipeline("text-classification", model=SPAM_MODEL)
17
 
 
23
 
24
  hate = pipeline("text-classification", model = HATE_MODEL)
25
 
26
+ image = pipeline("image-classification", model = IMAGE_MODEL)
27
+
28
 
29
  app = FastAPI()
30