Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
707023d1
Unverified
Commit
707023d1
authored
Jun 09, 2023
by
Yih-Dar
Committed by
GitHub
Jun 09, 2023
Browse files
Fix TF Rag OOM issue (#24122)
fix Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
f2b91835
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
tests/models/rag/test_modeling_tf_rag.py
tests/models/rag/test_modeling_tf_rag.py
+6
-0
No files found.
tests/models/rag/test_modeling_tf_rag.py
View file @
707023d1
from
__future__
import
annotations
import
gc
import
json
import
os
import
shutil
...
...
@@ -550,6 +551,11 @@ class TFRagDPRBartTest(TFRagTestMixin, unittest.TestCase):
@
require_sentencepiece
@
require_tokenizers
class
TFRagModelIntegrationTests
(
unittest
.
TestCase
):
def
tearDown
(
self
):
super
().
tearDown
()
# clean-up as much as possible GPU memory occupied by PyTorch
gc
.
collect
()
@
cached_property
def
token_model
(
self
):
return
TFRagTokenForGeneration
.
from_pretrained_question_encoder_generator
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment