waqasali1707 commited on
Commit
442a87e
·
verified ·
1 Parent(s): 2fa5632

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -2,12 +2,15 @@ import streamlit as st
2
  import torch
3
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, GenerationConfig
4
 
 
 
 
5
  # Update this to your model's Hugging Face path
6
  model_name = "waqasali1707/Bart-Base-Summarization"
7
 
8
  try:
9
- tokenizer = AutoTokenizer.from_pretrained(model_name)
10
- model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
11
  except Exception as e:
12
  st.error(f"Failed to load model: {e}")
13
 
 
2
  import torch
3
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, GenerationConfig
4
 
5
+ # Your Hugging Face token
6
+ hf_token = "YOUR_HUGGING_FACE_TOKEN"
7
+
8
  # Update this to your model's Hugging Face path
9
  model_name = "waqasali1707/Bart-Base-Summarization"
10
 
11
  try:
12
+ tokenizer = AutoTokenizer.from_pretrained(model_name, use_auth_token=hf_token)
13
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_name, use_auth_token=hf_token)
14
  except Exception as e:
15
  st.error(f"Failed to load model: {e}")
16