Skip to content

Commit

Permalink
feat: Add device mapping for llmlingua2
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnusS0 committed Mar 25, 2024
1 parent c32ee0b commit a0a3c43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion huginn_hears/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def load_extractive_summarizer(self):
"""
model = PromptCompressor(
model_name=self.model_name,
use_llmlingua2=True
use_llmlingua2=True,
device_map="cuda" if torch.cuda.is_available() else "cpu"
)
try:
yield model
Expand Down

0 comments on commit a0a3c43

Please sign in to comment.