Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,14 +11,16 @@ with open("vocab.txt", mode = "r", encoding = "utf-8") as file:
|
|
| 11 |
for token in file:
|
| 12 |
vocab.append(token.replace("\n", ""))
|
| 13 |
|
| 14 |
-
tokenizer = text.FastBertTokenizer(vocab, support_detokenization = True)
|
| 15 |
-
|
| 16 |
VOCAB_SIZE = len(vocab)
|
| 17 |
D_MODEL = 256
|
| 18 |
NB_LAYERS = 6
|
| 19 |
FFN_UNITS = 2048
|
| 20 |
NB_PROJ = 8
|
| 21 |
DROPOUT_RATE = 0.1
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
transformer = Transformer(vocab_size_enc = VOCAB_SIZE,
|
| 24 |
vocab_size_dec = 1,
|
|
|
|
| 11 |
for token in file:
|
| 12 |
vocab.append(token.replace("\n", ""))
|
| 13 |
|
|
|
|
|
|
|
| 14 |
VOCAB_SIZE = len(vocab)
|
| 15 |
D_MODEL = 256
|
| 16 |
NB_LAYERS = 6
|
| 17 |
FFN_UNITS = 2048
|
| 18 |
NB_PROJ = 8
|
| 19 |
DROPOUT_RATE = 0.1
|
| 20 |
+
MAX_LENGTH = 50
|
| 21 |
+
|
| 22 |
+
tokenizer = text.FastBertTokenizer(vocab, support_detokenization = True)
|
| 23 |
+
trimer = text.WaterfallTrimmer(max_seq_length = MAX_LENGTH)
|
| 24 |
|
| 25 |
transformer = Transformer(vocab_size_enc = VOCAB_SIZE,
|
| 26 |
vocab_size_dec = 1,
|