aunghlaing commited on
Commit
a515aaf
Β·
verified Β·
1 Parent(s): b5c64a1
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -36,15 +36,15 @@ def load_model(repo_id):
36
  except Exception as e:
37
  st.error(f"❌ Error downloading model: {str(e)}")
38
  return None, None
39
-
40
- # πŸ“Œ Load TensorFlow Model and Tokenizer (FIXED: Use from_tf=True)
41
  try:
42
- model = TFDistilBertForSequenceClassification.from_pretrained(download_dir, from_tf=True)
43
  tokenizer = DistilBertTokenizer.from_pretrained(download_dir)
44
  except Exception as e:
45
  st.error(f"❌ Error loading model: {str(e)}")
46
- return None, None
47
-
48
  return model, tokenizer
49
 
50
  # βœ… Load Model
 
36
  except Exception as e:
37
  st.error(f"❌ Error downloading model: {str(e)}")
38
  return None, None
39
+
40
+ # πŸ“Œ Load Model and Tokenizer (Remove `from_tf=True`)
41
  try:
42
+ model = TFDistilBertForSequenceClassification.from_pretrained(download_dir) # βœ… FIX: Removed `from_tf=True`
43
  tokenizer = DistilBertTokenizer.from_pretrained(download_dir)
44
  except Exception as e:
45
  st.error(f"❌ Error loading model: {str(e)}")
46
+ model, tokenizer = None, None
47
+
48
  return model, tokenizer
49
 
50
  # βœ… Load Model