Run this model with HF Jobs
Run seungbo7747/summarization_model on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/seungbo7747/summarization_model. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/seungbo7747/summarization_model on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use seungbo7747/summarization_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use seungbo7747/summarization_model with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("seungbo7747/summarization_model") model = AutoModelForSeq2SeqLM.from_pretrained("seungbo7747/summarization_model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
End of training
Browse filesFiles changed (3)
- README.md+18-93
- model.safetensors+1-1
- training_args.bin+1-1
17 unmodified lines181920212223242526272818 unmodified lines474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314417 unmodified linesThis model is a fine-tuned version of [paust/pko-t5-base](https://huggingface.co/paust/pko-t5-base) on an unknown dataset.It achieves the following results on the evaluation set:- Loss: 0.5908- Rouge1: 0.0915- Rouge2: 0.0239- Rougel: 0.0906- Rougelsum: 0.0905## Model description18 unmodified lines- seed: 42- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments- lr_scheduler_type: linear- num_epochs: 1- mixed_precision_training: Native AMP### Training results| Training Loss | Epoch | Step | Validation Loss | Rouge1 | Rouge2 | Rougel | Rougelsum ||:-------------:|:-----:|:----:|:---------------:|:------:|:------:|:------:|:---------:|| 0.7355 | 0.24 | 300 | 0.6505 | 0.0612 | 0.0114 | 0.0615 | 0.0615 || 0.6806 | 0.48 | 600 | 0.6223 | 0.0849 | 0.0200 | 0.0848 | 0.0846 || 0.6835 | 0.72 | 900 | 0.6020 | 0.0833 | 0.0205 | 0.0835 | 0.0834 || 0.6402 | 0.96 | 1200 | 0.5970 | 0.0855 | 0.0213 | 0.0854 | 0.0855 |### How to```pythonimport torchfrom transformers import T5TokenizerFast, T5ForConditionalGeneration# 1. λͺ¨λΈ λ° ν ν¬λμ΄μ λ‘λmodel_id = "seungbo7747/summarization_model"tokenizer = T5TokenizerFast.from_pretrained(model_id)model = T5ForConditionalGeneration.from_pretrained(model_id)# 2. GPU μ€μ (κ°λ₯ν κ²½μ°)device = torch.device("cuda" if torch.cuda.is_available() else "cpu")model.to(device)print(f"Using device: {device}")if torch.cuda.is_available():print(f"GPU name: {torch.cuda.get_device_name(0)}")# 3. μμ½ ν¨μ μ μdef summarize_text(texts, max_input_length=512, max_output_length=150, num_beams=4):"""μ£Όμ΄μ§ ν μ€νΈ 리μ€νΈλ₯Ό μμ½νλ ν¨μ.Args:texts (list[str]): μμ½ν ν μ€νΈ 리μ€νΈ (κ° ν μ€νΈλ 'summarize: ' μ λμ¬ ν¬ν¨ κ°λ₯).max_input_length (int): μ λ ₯ ν μ€νΈ μ΅λ κΈΈμ΄.max_output_length (int): μΆλ ₯ μμ½ μ΅λ κΈΈμ΄.num_beams (int): λΉ μμΉμμ μ¬μ©ν λΉ μ.Returns:list[str]: μμ½λ ν μ€νΈ 리μ€νΈ."""# μ λ ₯ ν μ€νΈμ 'summarize: ' μ λμ¬ μΆκ° (μλ κ²½μ°)inputs = [f"summarize: {text}" if not text.startswith("summarize: ") else text for text in texts]# ν ν°νtokenized_inputs = tokenizer(inputs,max_length=max_input_length,truncation=True,padding=True,return_tensors="pt")# GPUλ‘ μ λ ₯ μ΄λtokenized_inputs = {k: v.to(device) for k, v in tokenized_inputs.items()}# μμ½ μμ±summary_ids = model.generate(tokenized_inputs["input_ids"],attention_mask=tokenized_inputs["attention_mask"],max_length=max_output_length,num_beams=num_beams,early_stopping=True)# λμ½λ©summaries = tokenizer.batch_decode(summary_ids, skip_special_tokens=True)return summaries# 4. ν μ€νΈ μ λ ₯ μμtest_texts = ["summarize: νκ΅μ μλλ μμΈμ λλ€. μμΈμ νλ°λ μ€λΆμ μμΉνλ©°, μΈκ΅¬λ μ½ 970λ§ λͺ μ λλ€. μμΈμ κ²½μ , λ¬Έν, μ μΉμ μ€μ¬μ§λ‘, νκ°μ΄ λμλ₯Ό κ°λ‘μ§λ₯΄λ©° λ§μ μμ¬μ μ μ°κ³Ό νλμ 건μΆλ¬Όμ΄ 곡쑴ν©λλ€.","summarize: μΈκ³΅μ§λ₯(AI)μ μ»΄ν¨ν° μμ€ν μ΄ μΈκ°μ μ§λ₯μ λͺ¨λ°©νκ±°λ μ΄μνλλ‘ λ§λλ κΈ°μ μ λλ€. AIλ λ¨Έμ λ¬λ, λ₯λ¬λ, μμ°μ΄ μ²λ¦¬ λ±μ λΆμΌλ‘ λλλ©°, μλ£, κΈμ΅, μ μ‘° λ± λ€μν μ°μ μμ νμ©λκ³ μμ΅λλ€. κ·Έλ¬λ AIμ μ€λ¦¬μ λ¬Έμ μ μΌμ리 λ체 μ°λ €λ μ κΈ°λκ³ μμ΅λλ€.","summarize: κΈ°ν λ³νλ μ§κ΅¬ μ¨λν, ν΄μλ©΄ μμΉ, κ·Ήλ¨μ κΈ°μ νμμ μ΄λνλ κΈλ‘λ² λ¬Έμ μ λλ€. μ΄μ°ννμ λ°°μΆ κ°μμ μ¬μ κ°λ₯ μλμ§ μ¬μ©μ΄ ν΄κ²°μ± μΌλ‘ μ μλμ§λ§, κ΅μ μ νλ ₯μ΄ λΆμ‘±ν μν©μ λλ€."]# 5. μμ½ μ€ν λ° κ²°κ³Ό μΆλ ₯summaries = summarize_text(test_texts)for i, (input_text, summary) in enumerate(zip(test_texts, summaries)):print(f"\nInput {i+1}: {input_text}")print(f"Summary {i+1}: {summary}")# 6. λ¨μΌ ν μ€νΈ μμ½ μμ (κ°λ¨ν μ¬μ©)single_text = "summarize: λΈλ‘체μΈμ λΆμ°λ λμ§νΈ μ₯λΆλ‘, κ±°λ λ°μ΄ν°λ₯Ό μνΈννμ¬ λ³΄μμ±κ³Ό ν¬λͺ μ±μ μ 곡ν©λλ€. λΉνΈμ½μΈκ³Ό κ°μ μνΈννλΏλ§ μλλΌ κ³΅κΈλ§ κ΄λ¦¬, μλ£ κΈ°λ‘ λ± λ€μν λΆμΌμμ νμ©λκ³ μμ΅λλ€."summary = summarize_text([single_text])[0]print(f"\nSingle Input: {single_text}")print(f"Single Summary: {summary}")```### Framework versions17 unmodified lines181920212223242526272818 unmodified lines474849505152535455565758596061626364656667686917 unmodified linesThis model is a fine-tuned version of [paust/pko-t5-base](https://huggingface.co/paust/pko-t5-base) on an unknown dataset.It achieves the following results on the evaluation set:- Loss: 0.7192- Rouge1: 0.0663- Rouge2: 0.0167- Rougel: 0.0663- Rougelsum: 0.0663## Model description18 unmodified lines- seed: 42- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments- lr_scheduler_type: linear- training_steps: 5000- mixed_precision_training: Native AMP### Training results| Training Loss | Epoch | Step | Validation Loss | Rouge1 | Rouge2 | Rougel | Rougelsum ||:-------------:|:------:|:----:|:---------------:|:------:|:------:|:------:|:---------:|| 1.1412 | 0.0111 | 500 | 0.8112 | 0.0612 | 0.0136 | 0.0611 | 0.0611 || 0.8494 | 0.0222 | 1000 | 0.7681 | 0.0651 | 0.0150 | 0.0651 | 0.0650 || 0.8299 | 0.0333 | 1500 | 0.7493 | 0.0659 | 0.0155 | 0.0658 | 0.0658 || 0.7919 | 0.0444 | 2000 | 0.7379 | 0.0663 | 0.0158 | 0.0662 | 0.0662 || 0.7858 | 0.0555 | 2500 | 0.7339 | 0.0667 | 0.0163 | 0.0667 | 0.0667 || 0.7953 | 0.0666 | 3000 | 0.7330 | 0.0674 | 0.0164 | 0.0674 | 0.0674 || 0.7769 | 0.0777 | 3500 | 0.7261 | 0.0679 | 0.0163 | 0.0679 | 0.0678 || 0.7752 | 0.0888 | 4000 | 0.7182 | 0.0683 | 0.0163 | 0.0683 | 0.0683 || 0.7743 | 0.0998 | 4500 | 0.7203 | 0.0682 | 0.0164 | 0.0681 | 0.0681 || 0.7851 | 0.1109 | 5000 | 0.7179 | 0.0684 | 0.0165 | 0.0683 | 0.0683 |### Framework versions
123version https://git-lfs.github.com/spec/v1oid sha256:4d50793ddc167ec54d1b2d6aebc313694068ebbddbde903ac7587d18a58caeb3size 1102350184123version https://git-lfs.github.com/spec/v1oid sha256:c7695f6cb2eb7b97708cd8464d7223ea0bc2a0fe8846cedc9124c35f4723564bsize 1102350184
123version https://git-lfs.github.com/spec/v1oid sha256:05e4de3527ceaf8d19db459136c8d07c7e8f1e8eceb5d5d8cb77dd4495de7877size 5368123version https://git-lfs.github.com/spec/v1oid sha256:9d7873673bc720e72537bf4e33a6337b67a6fa36414171e3c9ebda81c392dc99size 5368
README.md+18-93
model.safetensors+1-1
training_args.bin+1-1