ImHadis commited on
Commit
67013df
·
verified ·
1 Parent(s): 549f2f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -6,9 +6,12 @@ from transformers import pipeline
6
  import gradio as gr
7
  from transformers import pipeline
8
 
 
9
 
 
 
10
  #Summarization endpoint
11
- get_completion = pipeline("summarization", model="shleifer/distilbart-cnn-12-6")
12
 
13
  def summarize(input):
14
  output = get_completion(input)
 
6
  import gradio as gr
7
  from transformers import pipeline
8
 
9
+ load_dotenv()
10
 
11
+ # Access the Hugging Face API key and endpoint URL
12
+ hf_api_key = os.getenv('HF_API_KEY')
13
  #Summarization endpoint
14
+ get_completion = pipeline("summarization", model="shleifer/distilbart-cnn-12-6", token=hf_api_key)
15
 
16
  def summarize(input):
17
  output = get_completion(input)