Translation_with_T5 / README.md
rahimizadeh's picture
Update README.md
81b96a3 verified

A newer version of the Gradio SDK is available: 5.33.0

Upgrade
metadata
title: English to French Translator
emoji: 🌍
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 5.29.0
app_file: app.py
pinned: true
license: apache-2.0
hardware:
  accelerator: CPU
  cpu: '2'
  memory: 8GB
env:
  - name: HF_TOKEN
    description: Hugging Face API token for private models
    required: false
datasets:
  - opus_books
  - wmt14
custom:
  progress: 'true'
  timeout: 300
  docker:
    parent_space: username/space-name
tags:
  - translation
  - nlp
  - t5
  - multilingual
  - huggingface

🌍 English-to-French Translation App

A Gradio web interface for translating English text to French using Hugging Face's T5 transformer models.

Encoder-Decoder Transformers (e.g., T5, BART, mT5) are comonly used for translation, summarization, question answering. They combine both encoder and decoder for input-output mappings.

Features

  • Model Selection: Choose between different T5 model sizes
    • t5-small: Faster inference
    • t5-base: Higher quality translations
  • Customizable Length: Control maximum translation output length
  • Example Texts: Try pre-loaded examples with one click
  • Responsive Design: Works on both desktop and mobile devices

How to Use

  1. Input Text:
    • Type or paste English text in the input box
  2. Select Model:
    • Choose your preferred balance of speed vs quality
  3. Adjust Length (Optional):
    • Use the slider to control translation length
  4. Click Translate:
    • Get instant French translation

Technical Details

Models Used

Dependencies

  • Transformers >=4.30.0
  • PyTorch >=1.10.0
  • Gradio >=3.40.0
  • SentencePiece (for tokenization)

Deployment

This app is designed for easy deployment on Hugging Face Spaces:

  1. Create a new Space
  2. Add these files:
    • app.py (main application)
    • requirements.txt (dependencies)
  3. The Space will automatically build and deploy

Local Development

To run locally:

pip install -r requirements.txt
python app.py