Spaces:
Build error
Build error
PeteBleackley
commited on
Commit
·
75a64b9
1
Parent(s):
33285bd
Authentication
Browse files- scripts.py +2 -0
scripts.py
CHANGED
|
@@ -5,6 +5,7 @@ import argparse
|
|
| 5 |
import pickle
|
| 6 |
import tokenizers
|
| 7 |
import transformers
|
|
|
|
| 8 |
import qarac.corpora.BNCorpus
|
| 9 |
import qarac.corpora.Batcher
|
| 10 |
import qarac.models.qarac_base_model
|
|
@@ -132,6 +133,7 @@ def train_models(path):
|
|
| 132 |
epochs=10,
|
| 133 |
workers=16,
|
| 134 |
use_multiprocessing=True)
|
|
|
|
| 135 |
trainer.question_encoder.push_to_hub('{}/qarac-roberta-question-encoder'.format(path))
|
| 136 |
trainer.answer_encoder.push_to_hub('{}/qarac-roberta-answer-encoder'.format(path))
|
| 137 |
trainer.decoder.push_to_hub('{}/qarac-roberta-decoder'.format(path))
|
|
|
|
| 5 |
import pickle
|
| 6 |
import tokenizers
|
| 7 |
import transformers
|
| 8 |
+
import huggingface_hub
|
| 9 |
import qarac.corpora.BNCorpus
|
| 10 |
import qarac.corpora.Batcher
|
| 11 |
import qarac.models.qarac_base_model
|
|
|
|
| 133 |
epochs=10,
|
| 134 |
workers=16,
|
| 135 |
use_multiprocessing=True)
|
| 136 |
+
huggingface_hub.login(token=os.environ['HUGGINGFACE_TOKEN'])
|
| 137 |
trainer.question_encoder.push_to_hub('{}/qarac-roberta-question-encoder'.format(path))
|
| 138 |
trainer.answer_encoder.push_to_hub('{}/qarac-roberta-answer-encoder'.format(path))
|
| 139 |
trainer.decoder.push_to_hub('{}/qarac-roberta-decoder'.format(path))
|