Views
No views yet
pip install transformers datasets torchbart_base_fine_tuned_cnn.ipynb → Jupyter notebook used for fine-tuningpytorch_model.bin, config.json, tokenizer.json, etc.)1from transformers import BartForConditionalGeneration, BartTokenizer
2
3model_name = "haydarkadioglu/bart-base-cnn-finetuned" # replace with your repo name
4tokenizer = BartTokenizer.from_pretrained(model_name)
5model = BartForConditionalGeneration.from_pretrained(model_name)
6
7text = "The US president gave a speech today about..."
8inputs = tokenizer([text], return_tensors="pt", max_length=1024, truncation=True)
9
10summary_ids = model.generate(
11 inputs["input_ids"],
12 num_beams=4,
13 max_length=150,
14 early_stopping=True
15)
16
17print(tokenizer.decode(summary_ids[0], skip_special_tokens=True))cnn_dailymail from Hugging Face)transformersdatasetstorchThe heatwave affecting different regions of Turkey continues to negatively impact daily life. According to a statement by the General Directorate of Meteorology, air temperatures are expected to remain 6 to 10 degrees above seasonal norms throughout the coming week. Especially the elderly, children, and people with chronic illnesses are advised not to go outside between 11:00 AM and 4:00 PM, when the sun is at its strongest. Meanwhile, municipalities have started taking various measures to create cool areas for citizens. While misting systems are being installed in parks and gardens, air-conditioned resting areas have also been made available in some regions.The heatwave affecting different regions of Turkey continues to negatively impact daily life .
The heat is expected to remain 6 to 10 degrees above seasonal norms throughout the coming week .
Municipalities have started taking various measures to create cool areas for citizens .