import requests
from bs4 import BeautifulSoup
from transformers import pipeline

# Fetch and parse the webpage
url = "https://example.com"
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')

# Extract text content
page_text = soup.get_text(separator="\n")

# Load a summarization pipeline with LLaMA 2 (assuming you have a suitable pipeline ready)
summarizer = pipeline("summarization", model="/var/www/.cache/huggingface/hub/models--meta-llama--Llama-3.2-11B-Vision-Instruct")

# Summarize the text content
summary = summarizer(page_text, max_length=150, min_length=50, do_sample=False)

print("Summary:", summary)
