Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,14 +22,14 @@ import streamlit as st
|
|
22 |
import requests
|
23 |
import torch
|
24 |
from transformers import pipeline
|
25 |
-
from transformers import
|
26 |
|
27 |
# Replace with your Hugging Face model repository path
|
28 |
model_repo_path = 'AbdurRehman313/BART_samsum'
|
29 |
|
30 |
# Load the model and tokenizer
|
31 |
-
model =
|
32 |
-
tokenizer =
|
33 |
|
34 |
# Initialize the summarization pipeline
|
35 |
summarizer = pipeline('summarization', model=model,tokenizer=tokenizer)
|
|
|
22 |
import requests
|
23 |
import torch
|
24 |
from transformers import pipeline
|
25 |
+
from transformers import BartTokenizer, BartForConditionalGeneration
|
26 |
|
27 |
# Replace with your Hugging Face model repository path
|
28 |
model_repo_path = 'AbdurRehman313/BART_samsum'
|
29 |
|
30 |
# Load the model and tokenizer
|
31 |
+
model = BartForConditionalGeneration.from_pretrained(model_repo_path)
|
32 |
+
tokenizer = BartTokenizer.from_pretrained(model_repo_path)
|
33 |
|
34 |
# Initialize the summarization pipeline
|
35 |
summarizer = pipeline('summarization', model=model,tokenizer=tokenizer)
|