Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Dec 16, 2024
1 parent 31f96ba commit 8c8d073
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions optimum_benchmark/backends/py_txi/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import torch
from huggingface_hub import snapshot_download
from py_txi import TEI, TGI, TEIConfig, TGIConfig
from safetensors.torch import save_file
from safetensors.torch import save_file, save_model

from ...task_utils import TEXT_EMBEDDING_TASKS, TEXT_GENERATION_TASKS
from ..base import Backend
Expand Down Expand Up @@ -60,7 +60,7 @@ def create_no_weights_model(self) -> None:
self.pretrained_model = self.automodel_loader.from_pretrained(
self.no_weights_model, **self.config.model_kwargs, device_map="auto", _fast_init=False
)
save_file(tensors=self.pretrained_model.state_dict(), filename=filename, metadata={"format": "pt"})
self.pretrained_model.save_pretrained(save_directory=self.no_weights_model)
del self.pretrained_model
torch.cuda.empty_cache()

Expand Down

0 comments on commit 8c8d073

Please sign in to comment.