Views
No views yet
| Attribute | Value |
|---|---|
| Base Model | t5-small |
| Dataset | Custom inventory reports |
| Max Input Tokens | 512 |
| Max Output Tokens | 128 |
| Epochs | 3 |
| Batch Size | 2 |
| Optimizer | AdamW |
| Loss Function | CrossEntropyLosS(with -100 padding mask) |
| Framework | PyTorch + Hugging Face Transformers |
| Hardware | CUDA-enabled GPU |
1
2from transformers import T5Tokenizer, T5ForConditionalGeneration, Trainer, TrainingArguments
3from datasets import Dataset
4import torch
5import torch.nn.functional as F
6
7model_name = "AventIQ-AI/Text_Summarization_For_inventory_Report"
8tokenizer = AutoTokenizer.from_pretrained(model_name)
9model = AutoModelForSequenceClassification.from_pretrained(model_name)
10model.eval()
11
12def preprocess(example):
13 input_text = "summarize: " + example["full_text"]
14 input_enc = tokenizer(input_text, truncation=True, padding="max_length", max_length=512)
15 target_enc = tokenizer(example["summary"], truncation=True, padding="max_length", max_length=64)
16 input_enc["labels"] = target_enc["input_ids"]
17 return input_enc
18
19# Generate summary
20summary = summarize(long_text, model, tokenizer)
21print("Summary:", summary)
22.
├── model/ # Contains the quantized model files
├── tokenizer_config/ # Tokenizer configuration and vocabulary files
├── model.safensors/ # Fine Tuned Model
├── README.md # Model documentation