add Baichuan2 models
Former-commit-id: 36960025e9274b574f57e7a7bf453cd96956e922
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import gc
|
||||
import torch
|
||||
from typing import TYPE_CHECKING, List, Optional, Tuple
|
||||
from transformers import InfNanRemoveLogitsProcessor, LogitsProcessorList
|
||||
@@ -98,6 +99,7 @@ def torch_gc() -> None:
|
||||
r"""
|
||||
Collects GPU memory.
|
||||
"""
|
||||
gc.collect()
|
||||
if torch.cuda.is_available():
|
||||
torch.cuda.empty_cache()
|
||||
torch.cuda.ipc_collect()
|
||||
|
||||
Reference in New Issue
Block a user