Khoa commited on
Commit
cfcaf52
·
verified ·
1 Parent(s): a3dda42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -221,6 +221,24 @@ def process_dataframe(
221
  return df, "\n".join(summary)
222
 
223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  def run_app(file, model_path, batch_size, max_length, skip_keyword_check, keywords):
225
  if file is None:
226
  raise gr.Error("Vui lòng upload file Excel trước.")
 
221
  return df, "\n".join(summary)
222
 
223
 
224
+ @spaces.GPU
225
+ def predict_batch_gpu(
226
+ texts,
227
+ tokenizer,
228
+ model,
229
+ device,
230
+ label_map,
231
+ max_length,
232
+ ):
233
+ return predict_batch(
234
+ texts,
235
+ tokenizer,
236
+ model,
237
+ device,
238
+ label_map,
239
+ max_length,
240
+ )
241
+
242
  def run_app(file, model_path, batch_size, max_length, skip_keyword_check, keywords):
243
  if file is None:
244
  raise gr.Error("Vui lòng upload file Excel trước.")