Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
53 |
summary = ""
|
54 |
-
|
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,
|
|
|
|
|
|
|
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()
|