jiangjiechen commited on
Commit
fc4b043
1 Parent(s): 35e858b

bug control

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -103,16 +103,18 @@ def gradio_formatter(js, output_type):
103
 
104
 
105
  def run(claim):
106
- # js = {
107
- # 'id': 0,
108
- # 'evidence': ['EVIDENCE1', 'EVIDENCE2'],
109
- # 'question': ['QUESTION1', 'QUESTION2'],
110
- # 'claim_phrases': ['CLAIMPHRASE1', 'CLAIMPHRASE2'],
111
- # 'local_premises': [['E1 ' * 100, 'E1 ' * 100, 'E1 ' * 10], ['E2', 'E2', 'E2']],
112
- # 'phrase_veracity': [[0.1, 0.5, 0.4], [0.1, 0.7, 0.2]],
113
- # 'claim_veracity': 'SUPPORT'
114
- # }
115
- js = loren.check(claim)
 
 
116
  loren.logger.warning(str(js))
117
  ev_html = gradio_formatter(js, 'e')
118
  z_html = gradio_formatter(js, 'z')
 
103
 
104
 
105
  def run(claim):
106
+ try:
107
+ js = loren.check(claim)
108
+ except:
109
+ js = {
110
+ 'id': 0,
111
+ 'evidence': ['EVIDENCE1', 'EVIDENCE2'],
112
+ 'question': ['QUESTION1', 'QUESTION2'],
113
+ 'claim_phrases': ['CLAIMPHRASE1', 'CLAIMPHRASE2'],
114
+ 'local_premises': [['E1 ' * 100, 'E1 ' * 100, 'E1 ' * 10], ['E2', 'E2', 'E2']],
115
+ 'phrase_veracity': [[0.1, 0.5, 0.4], [0.1, 0.7, 0.2]],
116
+ 'claim_veracity': 'Oops! Something went wrong.'
117
+ }
118
  loren.logger.warning(str(js))
119
  ev_html = gradio_formatter(js, 'e')
120
  z_html = gradio_formatter(js, 'z')