Edit model card

Model Card for Model ID

A language translation model fine-tuned on opus100 dataset for English to French translation.

Model Description

  • Model type: Language Model
  • Language(s) (NLP): English, French
  • License: Apache 2.0
  • Finetuned from model: T5-small

Uses

The model is intended to use for English to French translation related tasks.

How to Get Started with the Model

Install necessary libraries

pip install transformers peft accelerate

Use the code below to get started with the model.

from peft import PeftModel, PeftConfig
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dmedhi/eng2french-t5-small")
model = AutoModelForSeq2SeqLM.from_pretrained("t5-small")
model = PeftModel.from_pretrained(model, "dmedhi/eng2french-t5-small")

context = tokenizer(["Do you want coffee?"], return_tensors='pt')
output = model.generate(**context)
result = tokenizer.decode(output[0], skip_special_tokens=True)
print(result)

# Output
# Tu veux du café?

Training Details

Training Data

  • Dataset used: Opus100
  • Subset: "en-fr"

Evaluation

  • global_step=5000
  • training_loss=1.295289501953125

Metrics

  • train_runtime = 1672.4371
  • train_samples_per_second = 23.917
  • train_steps_per_second = 2.99
  • total_flos = 685071170273280.0
  • train_loss = 1.295289501953125
  • epoch = 20.0

Compute Instance

  • Google Colab - T4 GPU (Free)

Framework versions

  • PEFT 0.7.1
Downloads last month
5
Inference Examples
Inference API (serverless) does not yet support peft models for this pipeline type.

Model tree for dmedhi/eng2french-t5-small

Base model

google-t5/t5-small
Adapter
(34)
this model

Dataset used to train dmedhi/eng2french-t5-small