mdAmin313 commited on
Commit
3efe84b
·
1 Parent(s): f1ae819

Initial commit: AI misinformation detector

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -20,8 +20,8 @@ def get_zs_pipe():
20
  if ZS_PIPE is None:
21
  try:
22
  from transformers import pipeline
23
- # Smaller model -> faster on Hugging Face Spaces
24
- ZS_PIPE = pipeline("zero-shot-classification", model="valhalla/distilbart-mnli-12-1")
25
  except Exception:
26
  ZS_PIPE = None
27
  return ZS_PIPE
@@ -31,12 +31,13 @@ def get_sente_model():
31
  if SENTE_MODEL is None:
32
  try:
33
  from sentence_transformers import SentenceTransformer
34
- # Lighter & faster (80MB instead of 400MB)
35
  SENTE_MODEL = SentenceTransformer("all-MiniLM-L6-v2")
36
  except Exception:
37
  SENTE_MODEL = None
38
  return SENTE_MODEL
39
 
 
40
  def get_gemini_client():
41
  global GEMINI_CLIENT
42
  if GEMINI_CLIENT is None:
 
20
  if ZS_PIPE is None:
21
  try:
22
  from transformers import pipeline
23
+ # much smaller model (~250MB vs 1.3GB)
24
+ ZS_PIPE = pipeline("zero-shot-classification", model="typeform/distilbert-base-uncased-mnli")
25
  except Exception:
26
  ZS_PIPE = None
27
  return ZS_PIPE
 
31
  if SENTE_MODEL is None:
32
  try:
33
  from sentence_transformers import SentenceTransformer
34
+ # smaller semantic similarity model (~80MB vs 400MB)
35
  SENTE_MODEL = SentenceTransformer("all-MiniLM-L6-v2")
36
  except Exception:
37
  SENTE_MODEL = None
38
  return SENTE_MODEL
39
 
40
+
41
  def get_gemini_client():
42
  global GEMINI_CLIENT
43
  if GEMINI_CLIENT is None: