Blaise-g commited on
Commit
86bfc94
Β·
1 Parent(s): 2bd32ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -48,7 +48,7 @@ def proc_submission(
48
 
49
  settings = {
50
  "length_penalty": float(length_penalty),
51
- "repetition_penalty": 3.5,#float(repetition_penalty),
52
  "no_repeat_ngram_size": 3,
53
  "encoder_no_repeat_ngram_size": 4,
54
  "num_beams": int(num_beams),
@@ -70,13 +70,20 @@ def proc_submission(
70
  else:
71
  tr_in = input_text
72
  msg = None
73
-
 
 
 
 
 
 
 
 
 
74
  _summaries = summarize_via_tokenbatches(
75
  tr_in,
76
- model_led_det if (model_type == "LED" and summary_type == "Detailed") else model_det,
77
- tokenizer_led_det if (model_type == "LED" and summary_type == "Detailed") else tokenizer_det,
78
- model_led_tldr if (model_type == "LED" and summary_type == "TLDR") else model_tldr,
79
- tokenizer_led_tldr if (model_type == "LED" and summary_type == "TLDR") else tokenizer_tldr,
80
  batch_length=token_batch_length,
81
  **settings,
82
  )
 
48
 
49
  settings = {
50
  "length_penalty": float(length_penalty),
51
+ "repetition_penalty": 3.5,
52
  "no_repeat_ngram_size": 3,
53
  "encoder_no_repeat_ngram_size": 4,
54
  "num_beams": int(num_beams),
 
70
  else:
71
  tr_in = input_text
72
  msg = None
73
+
74
+ if (model_type == "LED" and summary_type == "Detailed"):
75
+ model = model_led_det
76
+ elif (model_type == "LED" and summary_type == "TLDR"):
77
+ model = model_led_tldr
78
+ elif (model_type == "LongT5" and summary_type == "Detailed"):
79
+ model = model_det
80
+ else:
81
+ model = model_tldr
82
+ #tokenizer_led_det if (model_type == "LED" and summary_type == "Detailed") else tokenizer_det,
83
  _summaries = summarize_via_tokenbatches(
84
  tr_in,
85
+ model = model,
86
+ tokenizer_led_det if (model_type == "LED") else tokenizer_det,
 
 
87
  batch_length=token_batch_length,
88
  **settings,
89
  )