transformers tensorboard safetensors t5 text2text-generation generated_from_trainer base_model:paust/pko-t5-base license:cc-by-4.0 autotrain_compatible endpoints_compatible text-generation-inference region:us
---
license: cc-by-4.0
base_model: paust/pko-t5-base
tags:
- generated_from_trainer
model-index:
- name: OndeviceAI-T5-base
  results: []
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# OndeviceAI-T5-base

This model is a fine-tuned version of [paust/pko-t5-base](https://huggingface.co/paust/pko-t5-base) on the None dataset.

## How to use
```python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
from typing import List
 
tokenizer = AutoTokenizer.from_pretrained("yeye776/OndeviceAI-T5-base")
model = AutoModelForSeq2SeqLM.from_pretrained("yeye776/OndeviceAI-T5-base")
 
prompt = "분류 및 인식해줘 :"
def prepare_input(question: str):
    inputs = f"{prompt} {question}"
    input_ids = tokenizer(inputs, max_length=700, return_tensors="pt").input_ids
    return input_ids
 
def inference(question: str) -> str:
    input_data = prepare_input(question=question)
    input_data = input_data.to(model.device)
    outputs = model.generate(inputs=input_data, num_beams=10, top_k=10, max_length=1024)
 
    result = tokenizer.decode(token_ids=outputs[0], skip_special_tokens=True)
 
    return result
 
inference("안방 조명 켜줘")
```

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 0.0007
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- gradient_accumulation_steps: 8
- total_train_batch_size: 32
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.06
- num_epochs: 10

### Training results



### Framework versions

- Transformers 4.36.2
- Pytorch 2.1.2+cu121
- Datasets 2.16.1
- Tokenizers 0.15.0
