pujithapsx commited on
Commit
c5a3a56
·
verified ·
1 Parent(s): 9fc5fea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -6,12 +6,14 @@ MODEL_NAME = "pujithapsx/address-crossencoder-bge-reranker-v2-m3-finetuned"
6
 
7
  print("Loading model...")
8
  #model = CrossEncoder(MODEL_NAME)
9
- model = CrossEncoder(
10
- MODEL_NAME,
11
- trust_remote_code=True, # allow custom model code
12
- automodel_args={"ignore_mismatched_sizes": True}, # skip size mismatch errors
13
- config_args={"model_type": "bert"}, # inject missing model_type
14
- )
 
 
15
  print("Model loaded successfully!")
16
 
17
  # STATIC THRESHOLD
 
6
 
7
  print("Loading model...")
8
  #model = CrossEncoder(MODEL_NAME)
9
+ # model = CrossEncoder(
10
+ # MODEL_NAME,
11
+ # trust_remote_code=True, # allow custom model code
12
+ # automodel_args={"ignore_mismatched_sizes": True}, # skip size mismatch errors
13
+ # config_args={"model_type": "bert"}, # inject missing model_type
14
+ # )
15
+ config = BertConfig.from_pretrained(MODEL_NAME) # BertConfig doesn't need model_type
16
+ hf_model = AutoModelForSequenceClassification.from_pretrained(MODEL_NAME, config=config)
17
  print("Model loaded successfully!")
18
 
19
  # STATIC THRESHOLD