Spaces:
Runtime error
Runtime error
liujch1998
commited on
Commit
β’
06cefb6
1
Parent(s):
8224785
Debug
Browse files
app.py
CHANGED
@@ -147,13 +147,13 @@ lock = threading.Lock()
|
|
147 |
# return record_feedback(output_raw, 'disagree', do_save)
|
148 |
|
149 |
def predict(statements, do_saves):
|
|
|
150 |
output_raws = interactive.runs(list(statements)) # statements is a tuple, but tokenizer takes a list
|
151 |
outputs = [{
|
152 |
'True': output_raw['score_calibrated'],
|
153 |
'False': 1 - output_raw['score_calibrated'],
|
154 |
} for output_raw in output_raws]
|
155 |
print('Logging statements to dataset:')
|
156 |
-
global lock
|
157 |
lock.acquire()
|
158 |
for output_raw, do_save in zip(output_raws, do_saves):
|
159 |
if do_save:
|
@@ -170,8 +170,8 @@ def predict(statements, do_saves):
|
|
170 |
[gr.update(value='Please share your feedback before trying out another statement.') for _ in statements]
|
171 |
|
172 |
def record_feedback(output_raws, feedback, do_saves):
|
173 |
-
print('Logging feedbacks to dataset:')
|
174 |
global lock
|
|
|
175 |
lock.acquire()
|
176 |
for output_raw, do_save in zip(output_raws, do_saves):
|
177 |
if do_save:
|
|
|
147 |
# return record_feedback(output_raw, 'disagree', do_save)
|
148 |
|
149 |
def predict(statements, do_saves):
|
150 |
+
global lock, interactive
|
151 |
output_raws = interactive.runs(list(statements)) # statements is a tuple, but tokenizer takes a list
|
152 |
outputs = [{
|
153 |
'True': output_raw['score_calibrated'],
|
154 |
'False': 1 - output_raw['score_calibrated'],
|
155 |
} for output_raw in output_raws]
|
156 |
print('Logging statements to dataset:')
|
|
|
157 |
lock.acquire()
|
158 |
for output_raw, do_save in zip(output_raws, do_saves):
|
159 |
if do_save:
|
|
|
170 |
[gr.update(value='Please share your feedback before trying out another statement.') for _ in statements]
|
171 |
|
172 |
def record_feedback(output_raws, feedback, do_saves):
|
|
|
173 |
global lock
|
174 |
+
print('Logging feedbacks to dataset:')
|
175 |
lock.acquire()
|
176 |
for output_raw, do_save in zip(output_raws, do_saves):
|
177 |
if do_save:
|