waqasali1707 commited on
Commit
813b18b
·
verified ·
1 Parent(s): 7677ed6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,12 +3,12 @@ import torch
3
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, GenerationConfig
4
 
5
  # Define the URL of your model on Hugging Face Spaces
6
- model_url = 'https://huggingface.co/spaces/waqasali1707/Bart-Base-Summarization/blob/main/bart-base.zip'
7
 
8
  # Load the model and tokenizer directly from the URL
9
  try:
10
- tokenizer = AutoTokenizer.from_pretrained(model_url)
11
- model = AutoModelForSeq2SeqLM.from_pretrained(model_url)
12
  except Exception as e:
13
  st.error(f"Failed to load model: {e}")
14
 
 
3
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, GenerationConfig
4
 
5
  # Define the URL of your model on Hugging Face Spaces
6
+ model_rpo = 'waqasali1707/Bart-Base-Summarization'
7
 
8
  # Load the model and tokenizer directly from the URL
9
  try:
10
+ tokenizer = AutoTokenizer.from_pretrained(model_rpo)
11
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_rpo)
12
  except Exception as e:
13
  st.error(f"Failed to load model: {e}")
14