Update src/models/summarization.py
Browse files
src/models/summarization.py
CHANGED
@@ -21,8 +21,6 @@ class Summarizer:
|
|
21 |
# Load the tokenizer
|
22 |
self.tokenizer = BartTokenizer.from_pretrained("facebook/bart-base")
|
23 |
|
24 |
-
# Move model to appropriate device (GPU if available)
|
25 |
-
self.model.to(torch.device('cuda' if torch.cuda.is_available() else 'cpu'))
|
26 |
return self.model
|
27 |
except Exception as e:
|
28 |
st.error(f"Error loading fine-tuned summarization model: {str(e)}")
|
|
|
21 |
# Load the tokenizer
|
22 |
self.tokenizer = BartTokenizer.from_pretrained("facebook/bart-base")
|
23 |
|
|
|
|
|
24 |
return self.model
|
25 |
except Exception as e:
|
26 |
st.error(f"Error loading fine-tuned summarization model: {str(e)}")
|