ganna217 commited on
Commit
589b738
·
1 Parent(s): 0ad264e
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -26,7 +26,7 @@ app = FastAPI()
26
  # Add CORS middleware to allow frontend requests
27
  app.add_middleware(
28
  CORSMiddleware,
29
- allow_origins=["*"], # Allow all origins (you can restrict this later)
30
  allow_credentials=True,
31
  allow_methods=["*"],
32
  allow_headers=["*"],
@@ -39,8 +39,8 @@ logger.info("Loading the model...")
39
  try:
40
  classifier = pipeline(
41
  "zero-shot-classification",
42
- model="asafaya/bert-base-arabic", # Use Arabic model
43
- tokenizer="asafaya/bert-base-arabic",
44
  cache_dir=cache_dir
45
  )
46
  logger.info("Model loaded successfully!")
 
26
  # Add CORS middleware to allow frontend requests
27
  app.add_middleware(
28
  CORSMiddleware,
29
+ allow_origins=["*"],
30
  allow_credentials=True,
31
  allow_methods=["*"],
32
  allow_headers=["*"],
 
39
  try:
40
  classifier = pipeline(
41
  "zero-shot-classification",
42
+ model="UBC-NLP/ARBERTv2", # Switch to a better Arabic model
43
+ tokenizer="UBC-NLP/ARBERTv2",
44
  cache_dir=cache_dir
45
  )
46
  logger.info("Model loaded successfully!")