xuandin commited on
Commit
ee53ecb
Β·
verified Β·
1 Parent(s): e12d665

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,9 +8,9 @@ from semviqa.tvc.tvc_eval import classify_claim
8
 
9
  # Load models with caching
10
  @st.cache_resource()
11
- def load_model(model_name, model_class):
12
  tokenizer = AutoTokenizer.from_pretrained(model_name)
13
- model = model_class.from_pretrained(model_name)
14
  return tokenizer, model
15
 
16
  # UI Configuration
@@ -26,7 +26,7 @@ st.markdown("""
26
  </style>
27
  """, unsafe_allow_html=True)
28
 
29
- st.markdown("<p class='big-title'>πŸ” SemViQA: Vietnamese Fact-Checking System</p>", unsafe_allow_html=True)
30
  st.markdown("<p class='sub-title'>Enter a claim and context to verify its accuracy</p>", unsafe_allow_html=True)
31
 
32
  # Sidebar - Configuration Settings
@@ -39,7 +39,7 @@ with st.sidebar.expander("βš™οΈ Settings", expanded=False):
39
 
40
  # Load selected models
41
  tokenizer_qatc, model_qatc = load_model(qatc_model_name, QATCForQuestionAnswering)
42
- tokenizer_bc, model_bc = load_model(bc_model_name, ClaimModelForClassification)
43
  tokenizer_tc, model_tc = load_model(tc_model_name, ClaimModelForClassification)
44
 
45
  # User Input Fields
 
8
 
9
  # Load models with caching
10
  @st.cache_resource()
11
+ def load_model(model_name, model_class, is_bc=False):
12
  tokenizer = AutoTokenizer.from_pretrained(model_name)
13
+ model = model_class.from_pretrained(model_name, num_labels=3 if not is_bc else 2)
14
  return tokenizer, model
15
 
16
  # UI Configuration
 
26
  </style>
27
  """, unsafe_allow_html=True)
28
 
29
+ st.markdown("<p class='big-title'>πŸ” SemViQA: A Semantic Question Answering System for Vietnamese Information Fact-Checking</p>", unsafe_allow_html=True)
30
  st.markdown("<p class='sub-title'>Enter a claim and context to verify its accuracy</p>", unsafe_allow_html=True)
31
 
32
  # Sidebar - Configuration Settings
 
39
 
40
  # Load selected models
41
  tokenizer_qatc, model_qatc = load_model(qatc_model_name, QATCForQuestionAnswering)
42
+ tokenizer_bc, model_bc = load_model(bc_model_name, ClaimModelForClassification, is_bc=True)
43
  tokenizer_tc, model_tc = load_model(tc_model_name, ClaimModelForClassification)
44
 
45
  # User Input Fields