File size: 1,829 Bytes
90779c2 2771f58 90779c2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
---
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
|