mksaad commited on
Commit
766e234
·
verified ·
1 Parent(s): 80a8e84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -7,6 +7,10 @@ from bs4 import BeautifulSoup
7
  import re
8
 
9
 
 
 
 
 
10
  from transformers import pipeline
11
  pipe = pipeline("text-generation", model="meta-llama/Llama-3.2-1B")
12
 
@@ -49,13 +53,16 @@ def get_clean_text(url):
49
 
50
 
51
 
52
- def summarize(alink):
53
  summary = ""
54
- alink = "https://www.aljazeeramubasher.net/palestine/"
55
  text = get_clean_text
56
  summary = pipe(f"summarize the following news into bullet points {text}")
57
  return summary
58
 
59
- gr.interface(fn=summarize, input="text", output="text")
 
 
 
60
 
61
  # gr.load("models/meta-llama/Llama-3.2-1B").launch()
 
7
  import re
8
 
9
 
10
+ from huggingface_hub import login
11
+ login()
12
+
13
+
14
  from transformers import pipeline
15
  pipe = pipeline("text-generation", model="meta-llama/Llama-3.2-1B")
16
 
 
53
 
54
 
55
 
56
+ def summarize(link):
57
  summary = ""
58
+ link = "https://www.aljazeeramubasher.net/palestine/"
59
  text = get_clean_text
60
  summary = pipe(f"summarize the following news into bullet points {text}")
61
  return summary
62
 
63
+ demo = gr.interface(fn=summarize, inputs="textbox", outputs="textbox")
64
+
65
+ if __name__ == "__main__":
66
+ demo.launch()
67
 
68
  # gr.load("models/meta-llama/Llama-3.2-1B").launch()