File size: 10,952 Bytes
e1e9659
bffe182
e0e9eb4
bffe182
e0e9eb4
e1e9659
bffe182
e1e9659
a8a4801
c76aa2a
a8a4801
 
c76aa2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e1e8ce3
c76aa2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c197a9
 
 
c76aa2a
 
 
 
 
 
 
a8da285
c76aa2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c197a9
 
4fc8613
c76aa2a
3c197a9
 
c76aa2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a8a4801
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
---
title: i18n Agent - Contribute in Just 5 Minutes
emoji: πŸ€—
colorFrom: yellow
colorTo: yellow
sdk: gradio
sdk_version: 5.33.1
app_file: app.py
pinned: true
tags:
- agent-demo-track
- Agents-MCP-Hackathon
---


<div align="center">

# 🌐 [i18n-agent] Hugging Face i18n made easy

*AI-powered translation agent for Hugging Face Transformers documentation internationalization*

[![Hugging Face Spaces](https://img.shields.io/badge/πŸ€—%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Agents-MCP-Hackathon/hf-transformers-docs-i18n-agent)
[![agent-demo-track](https://img.shields.io/badge/πŸ€–-agent--demo--track-ff6b6b)](https://github.com/topics/agent-demo-track)

![KREW x Hugging Face Logo](images/title.png)

**Streamline Hugging Face Transformers documentation translation with Claude AI**   
β€’ **Auto-generate GitHub PRs** β€’ **Multi-language support**

> 🎯 **Created to address [Hugging Face Transformers Issue #20179](https://github.com/huggingface/transformers/issues/20179)** - Making documentation translation more accessible and automated for the global community.

[πŸš€ Try Live Demo](https://huggingface.co/spaces/Agents-MCP-Hackathon/hf-transformers-docs-i18n-agent) β€’ [πŸ“Ή Watch Demo](https://youtu.be/Xym6w9bMQXM) β€’ [πŸ“– Documentation](#-quick-start)

</div>

---

## ✨ What is this?

Transform the way you contribute to Hugging Face Transformers' global community! This AI agent automatically:

- πŸ” **Discovers** missing translations in [Transformers documentation](https://huggingface.co/docs/transformers/en/index)
- πŸ€– **Translates** using Claude Sonnet 4 with technical precision  
- πŸ“ **Creates** GitHub pull requests ready for review on [huggingface/transformers](https://github.com/huggingface/transformers)
- πŸ’¬ **Guides** you through the entire process

> **Perfect for**: Contributors addressing [Issue #20179](https://github.com/huggingface/transformers/issues/20179), documentation maintainers, and international communities wanting to make transformer models accessible worldwide.

## 🎯 Addressing the Community Need

This project was specifically created to solve [Hugging Face Transformers Issue #20179](https://github.com/huggingface/transformers/issues/20179), which highlights the need for better internationalization tooling. Our agent tackles the core challenges mentioned in the issue:

- **🚧 Translation Bottlenecks**: Automates the manual translation process
- **πŸ“Š Consistency Issues**: Maintains uniform translation quality within each languages  
- **⚑ Scalability Problems**: Handles batch translations efficiently
- **🀝 Contributor Barriers**: Simplifies the PR creation workflow for translators

## πŸŽ₯ Demo Video

*Click image to link to demo video*
[![image/png](https://cdn-uploads.huggingface.co/production/uploads/644a081386e837e3d58831e8/ElUN6EarvTX9qWdaPCNlk.png)](https://youtu.be/Xym6w9bMQXM)
πŸ”— https://youtu.be/Xym6w9bMQXM  

*Watch the complete walkthrough: from setup to PR creation in under 5 minutes*

## πŸš€ Quick Start


### Option 1: One-Click Demo (Recommended)
[![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-md-dark.svg)](https://huggingface.co/spaces/Agents-MCP-Hackathon/hf-transformers-docs-i18n-agent)

βœ… **No setup required!** Just click and start translating.  
βœ… **Pre-requisites!** Need `Anthropic API key` and `Github token`.

### Option 2: Run Locally

<details>
<summary>πŸ› οΈ Local Installation Guide</summary>

```bash
# Clone the repo
git clone https://github.com/Hugging-Face-KREW/i18n-agent.git
cd i18n-agent

# Install dependencies  
pip install -r requirements.txt

# Set up your keys
cp .env.example .env
# Add your Anthropic API key and GitHub token

# Launch the app
python app.py
```

</details>

## 🎯 How It Works

This agent specifically targets the [Hugging Face Transformers documentation](https://huggingface.co/docs/transformers/en/index) and submits PRs addressing [Issue #20179](https://github.com/huggingface/transformers/issues/20179) in the [huggingface/transformers](https://github.com/huggingface/transformers) repository.

<div align="center">

![KREW x Hugging Face Logo](images/overview.png)

</div>

### Step 1: πŸ” Discover Translation Targets
- Select your target language (Korean, and more languages will be supported)
- Set how many files to process
- Let AI identify the most impactful Transformers docs translations

### Step 2: πŸ€– Smart Translation
- Enter your Anthropic API key
- Claude Sonnet 4 translates with context awareness
- Technical terms and code blocks preserved automatically

### Step 3: πŸ“ Automated PR Creation  
- Configure GitHub credentials
- System creates properly formatted pull requests for [huggingface/transformers](https://github.com/huggingface/transformers)
- Optional: Use reference PRs for consistency

## 🌍 Supported Languages

<div align="center">

| Language | Code | Status |
|----------|------|--------|
| πŸ‡°πŸ‡· Korean | `ko` | βœ… Fully Supported |

*And more languages coming soon...*

</div>

## πŸ—οΈ Architecture

<div align="center">
    <a href="images/workflow.png" target="_blank">
        <img src="images/workflow.png" alt="KREW x Hugging Face Logo" width="400">
    </a>
</div>

<details>

<summary>πŸ“Š System Design Overview</summary>

**Frontend Layer**
- Gradio web interface with modern styling
- Real-time chat & quick controls with AI agent
- Progress tracking missing 

**AI Processing Layer**  
- File discovery with intelligent prioritization for Transformers docs
- Claude Sonnet 4 for context-aware translation
- LangChain integration for PR research

**Integration Layer**
- GitHub API for automated PR creation to [huggingface/transformers](https://github.com/huggingface/transformers)
- Branch management and commit structuring
- Template matching from reference PRs

</details>

## βš™οΈ Configuration

### For Spaces Deployment
Prepare these secrets:

```bash
ANTHROPIC_API_KEY=your_claude_api_key
GITHUB_TOKEN=your_github_token  
```

### For Local Development
Create `.env` file:

```bash
ANTHROPIC_API_KEY=<your api key>

# GitHub PR Agent Configuration
GITHUB_TOKEN=<your github token>
GITHUB_OWNER=<your github username>
GITHUB_REPO=<your repository name>
REFERENCE_PR_URL=<reference pr url for style analysis>
```

## 🀝 Contributing

<div align="center">

**Love this project? Here's how you can help:**

[![Fork](https://img.shields.io/github/forks/username/repo?style=social)](https://github.com/Hugging-Face-KREW/i18n-agent.git)
[![Star](https://img.shields.io/github/stars/username/repo?style=social)](https://github.com/Hugging-Face-KREW/i18n-agent.git)
[![Issues](https://img.shields.io/github/issues/username/repo)](https://github.com/Hugging-Face-KREW/i18n-agent.git)

</div>

### πŸ‘₯ Contributors

πŸ€— [email protected] / @harheem  
πŸ€— [email protected] / @Jwaminju

## πŸ’‘ Use Cases

> **🌟 Real-world scenarios where this agent shines:**

- **πŸ“š Documentation Teams**: Batch translate Transformers documentation updates
- **🌍 Community Contributors**: Help make Transformers accessible in your language  
- **🏒 Organizations**: Streamline i18n workflows for Transformers library
- **πŸ‘¨β€πŸ’» Developers**: Contribute Transformers translations without manual GitHub workflow
- **🎯 Issue #20179 Contributors**: Directly address the internationalization challenges raised by the community

## πŸ› οΈ Tech Stack

<div align="center">

![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
![Gradio](https://img.shields.io/badge/gradio-FF6B35?style=for-the-badge&logo=gradio&logoColor=white)
![Anthropic](https://img.shields.io/badge/Claude-191919?style=for-the-badge&logo=anthropic&logoColor=white)
![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)
![LangChain](https://img.shields.io/badge/LangChain-121212?style=for-the-badge&logo=chainlink&logoColor=white)

</div>

## ❓ FAQ

<details>
<summary><strong>Q: How does this relate to Issue #20179?</strong></summary>
<br>
This agent directly addresses the pain points raised in <a href="https://github.com/huggingface/transformers/issues/20179">Issue #20179</a> by automating the translation workflow, reducing manual overhead, and making it easier for contributors to submit high-quality translations.
</details>

<details>
<summary><strong>Q: How accurate are the translations?</strong></summary>
<br>
The agent uses Claude Sonnet 4, which provides high-quality translations with technical context awareness. It preserves code blocks, maintains formatting, and follows established translation patterns.
</details>

<details>
<summary><strong>Q: What permissions do I need for GitHub integration?</strong></summary>
<br>
Your GitHub token needs repository read/write permissions and the ability to create branches and pull requests on the target repository.
</details>

<details>
<summary><strong>Q: Can I customize the translation style?</strong></summary>
<br>
Yes! You can provide reference PR URLs to match existing translation patterns and maintain consistency with community standards.
</details>

## πŸ› Troubleshooting

### Common Issues

<details>
<summary><strong>API Key Issues</strong></summary>

- Ensure your Anthropic API key is valid and has sufficient credits  
- Check that your GitHub token has the necessary repository permissions  

</details>

<details>
<summary><strong>Translation Quality</strong></summary>

- The system uses Claude Sonnet 4 for high-quality translations  
- Formatting and markdown structure is maintained  
- Please restart the translation again if you met format issue

</details>

<details>
<summary><strong>GitHub PR Creation</strong></summary>

- Verify repository permissions and branch protection rules  
- Check that the reference PR URL is accessible and valid  

</details>


## πŸ™ Acknowledgments

Special thanks to the amazing communities that make this possible:

- **πŸ€— Hugging Face** - For building the Transformers library and comprehensive documentation
- **🎭 Anthropic** - For Claude's incredible language capabilities  
- **πŸ‘₯ Hugging Face KREW Community** - For championing Korean AI translation
- **🎨 Gradio** - For making beautiful AI interfaces simple
- **🌍 Community Contributors** - For raising awareness through [Issue #20179](https://github.com/huggingface/transformers/issues/20179)

---

<div align="center">

**Made with ❀️ for global accessibility of Hugging Face Transformers documentation.**

**🎯 Solving [Issue #20179](https://github.com/huggingface/transformers/issues/20179) one translation at a time.**

[⭐ Star this repo](https://github.com/Hugging-Face-KREW/i18n-agent.git) β€’ [πŸ› Report Bug](https://github.com/Hugging-Face-KREW/i18n-agent.git) β€’ [πŸ’‘ Request Feature](https://github.com/Hugging-Face-KREW/i18n-agent.git)

</div>