Harheem Kim commited on
Commit
8837c6f
Β·
unverified Β·
2 Parent(s): 42d1e42 8f9a6af

Merge pull request #1 from Jwaminju/patch-1

Browse files
Files changed (1) hide show
  1. README.md +298 -0
README.md CHANGED
@@ -7,4 +7,302 @@ sdk: gradio
7
  sdk_version: "5.33.0"
8
  app_file: app.py
9
  pinned: false
 
 
 
10
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  sdk_version: "5.33.0"
8
  app_file: app.py
9
  pinned: false
10
+ tags:
11
+ - agent-demo-track
12
+ - Agents-MCP-Hackathon
13
  ---
14
+
15
+ <div align="center">
16
+
17
+ # 🌐 [i18n-agent] Hugging Face i18n made easy
18
+
19
+ *AI-powered translation agent for Hugging Face Transformers documentation internationalization*
20
+
21
+ [![Hugging Face Spaces](https://img.shields.io/badge/πŸ€—%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Agents-MCP-Hackathon/hf-transformers-docs-i18n-agent)
22
+ [![agent-demo-track](https://img.shields.io/badge/πŸ€–-agent--demo--track-ff6b6b)](https://github.com/topics/agent-demo-track)
23
+
24
+ ![KREW x Hugging Face Logo](images/title.png)
25
+
26
+ **Streamline Hugging Face Transformers documentation translation with Claude AI**
27
+ β€’ **Auto-generate GitHub PRs** β€’ **Multi-language support**
28
+
29
+ > 🎯 **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.
30
+
31
+ [πŸš€ Try Live Demo](https://huggingface.co/spaces/Agents-MCP-Hackathon/hf-transformers-docs-i18n-agent) β€’ [πŸ“Ή Watch Demo](#-demo-video) β€’ [πŸ“– Documentation](#-quick-start)
32
+
33
+ </div>
34
+
35
+ ---
36
+
37
+ ## ✨ What is this?
38
+
39
+ Transform the way you contribute to Hugging Face Transformers' global community! This AI agent automatically:
40
+
41
+ - πŸ” **Discovers** missing translations in [Transformers documentation](https://huggingface.co/docs/transformers/en/index)
42
+ - πŸ€– **Translates** using Claude Sonnet 4 with technical precision
43
+ - πŸ“ **Creates** GitHub pull requests ready for review on [huggingface/transformers](https://github.com/huggingface/transformers)
44
+ - πŸ’¬ **Guides** you through the entire process
45
+
46
+ > **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.
47
+
48
+ ## 🎯 Addressing the Community Need
49
+
50
+ 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:
51
+
52
+ - **🚧 Translation Bottlenecks**: Automates the manual translation process
53
+ - **πŸ“Š Consistency Issues**: Maintains uniform translation quality within each languages
54
+ - **⚑ Scalability Problems**: Handles batch translations efficiently
55
+ - **🀝 Contributor Barriers**: Simplifies the PR creation workflow for translators
56
+
57
+ ## πŸŽ₯ Demo Video
58
+
59
+ [![Hugging Face i18n Agent Demo](https://img.youtube.com/vi/YOUR_VIDEO_ID/maxresdefault.jpg)](https://www.youtube.com/watch?v=YOUR_VIDEO_ID)
60
+
61
+ *Watch the complete walkthrough: from setup to PR creation in under 5 minutes*
62
+
63
+ ## πŸš€ Quick Start
64
+
65
+ ![KREW x Hugging Face Logo](images/demo.png)
66
+
67
+ ### Option 1: One-Click Demo (Recommended)
68
+ [![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-md-dark.svg)](https://huggingface.co/spaces/YOUR_USERNAME/i18n-agent)
69
+
70
+ βœ… **No setup required!** Just click and start translating.
71
+ βœ… **Pre-requisites!** Need `Anthropic API key` and `Github token`.
72
+
73
+ ### Option 2: Run Locally
74
+
75
+ <details>
76
+ <summary>πŸ› οΈ Local Installation Guide</summary>
77
+
78
+ ```bash
79
+ # Clone the repo
80
+ git clone https://github.com/Hugging-Face-KREW/i18n-agent.git
81
+ cd i18n-agent
82
+
83
+ # Install dependencies
84
+ pip install -r requirements.txt
85
+
86
+ # Set up your keys
87
+ cp .env.example .env
88
+ # Add your Anthropic API key and GitHub token
89
+
90
+ # Launch the app
91
+ python app.py
92
+ ```
93
+
94
+ </details>
95
+
96
+ ## 🎯 How It Works
97
+
98
+ 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.
99
+
100
+ ```mermaid
101
+ graph LR
102
+ A[πŸ” Find Files] --> B[πŸ€– Translate] --> C[πŸ“ Create PR]
103
+
104
+ A --> A1[Scan transformers docs]
105
+ A --> A2[Identify translation gaps]
106
+
107
+ B --> B1[Claude AI translation]
108
+ B --> B2[Preserve formatting]
109
+
110
+ C --> C1[Auto-branch creation]
111
+ C --> C2[Submit to huggingface/transformers]
112
+ ```
113
+
114
+ ### Step 1: πŸ” Discover Translation Targets
115
+ - Select your target language (Korean, and more languages will be supported)
116
+ - Set how many files to process
117
+ - Let AI identify the most impactful Transformers docs translations
118
+
119
+ ### Step 2: πŸ€– Smart Translation
120
+ - Enter your Anthropic API key
121
+ - Claude Sonnet 4 translates with context awareness
122
+ - Technical terms and code blocks preserved automatically
123
+
124
+ ### Step 3: πŸ“ Automated PR Creation
125
+ - Configure GitHub credentials
126
+ - System creates properly formatted pull requests for [huggingface/transformers](https://github.com/huggingface/transformers)
127
+ - Optional: Use reference PRs for consistency
128
+
129
+ ## 🌍 Supported Languages
130
+
131
+ <div align="center">
132
+
133
+ | Language | Code | Status |
134
+ |----------|------|--------|
135
+ | πŸ‡°πŸ‡· Korean | `ko` | βœ… Fully Supported |
136
+
137
+ *And more languages coming soon...*
138
+
139
+ </div>
140
+
141
+ ## πŸ—οΈ Architecture
142
+
143
+ <div align="center">
144
+ <a href="images/workflow.png" target="_blank">
145
+ <img src="images/workflow.png" alt="KREW x Hugging Face Logo" width="400">
146
+ </a>
147
+ </div>
148
+
149
+ <details>
150
+
151
+ <summary>πŸ“Š System Design Overview</summary>
152
+
153
+ **Frontend Layer**
154
+ - Gradio web interface with modern styling
155
+ - Real-time chat & quick controls with AI agent
156
+ - Progress tracking missing
157
+
158
+ **AI Processing Layer**
159
+ - File discovery with intelligent prioritization for Transformers docs
160
+ - Claude Sonnet 4 for context-aware translation
161
+ - LangChain integration for PR research
162
+
163
+ **Integration Layer**
164
+ - GitHub API for automated PR creation to [huggingface/transformers](https://github.com/huggingface/transformers)
165
+ - Branch management and commit structuring
166
+ - Template matching from reference PRs
167
+
168
+ </details>
169
+
170
+ ## βš™οΈ Configuration
171
+
172
+ ### For Spaces Deployment
173
+ Prepare these secrets:
174
+
175
+ ```bash
176
+ ANTHROPIC_API_KEY=your_claude_api_key
177
+ GITHUB_TOKEN=your_github_token
178
+ ```
179
+
180
+ ### For Local Development
181
+ Create `.env` file:
182
+
183
+ ```bash
184
+ ANTHROPIC_API_KEY=<your api key>
185
+
186
+ # GitHub PR Agent Configuration
187
+ GITHUB_TOKEN=<your github token>
188
+ GITHUB_OWNER=<your github username>
189
+ GITHUB_REPO=<your repository name>
190
+ REFERENCE_PR_URL=<reference pr url for style analysis>
191
+ ```
192
+
193
+ ## 🀝 Contributing
194
+
195
+ <div align="center">
196
+
197
+ **Love this project? Here's how you can help:**
198
+
199
+ [![Fork](https://img.shields.io/github/forks/username/repo?style=social)](https://github.com/Hugging-Face-KREW/i18n-agent.git)
200
+ [![Star](https://img.shields.io/github/stars/username/repo?style=social)](https://github.com/Hugging-Face-KREW/i18n-agent.git)
201
+ [![Issues](https://img.shields.io/github/issues/username/repo)](https://github.com/Hugging-Face-KREW/i18n-agent.git)
202
+
203
+ </div>
204
+
205
+ ### πŸ‘₯ Contributors
206
+
207
+ πŸ€— shhr.kre@gmail.com / @harheem
208
+ πŸ€— jminj6@gmail.com / @Jwaminju
209
+
210
+ ## πŸ’‘ Use Cases
211
+
212
+ > **🌟 Real-world scenarios where this agent shines:**
213
+
214
+ - **πŸ“š Documentation Teams**: Batch translate Transformers documentation updates
215
+ - **🌍 Community Contributors**: Help make Transformers accessible in your language
216
+ - **🏒 Organizations**: Streamline i18n workflows for Transformers library
217
+ - **πŸ‘¨β€πŸ’» Developers**: Contribute Transformers translations without manual GitHub workflow
218
+ - **🎯 Issue #20179 Contributors**: Directly address the internationalization challenges raised by the community
219
+
220
+ ## πŸ› οΈ Tech Stack
221
+
222
+ <div align="center">
223
+
224
+ ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
225
+ ![Gradio](https://img.shields.io/badge/gradio-FF6B35?style=for-the-badge&logo=gradio&logoColor=white)
226
+ ![Anthropic](https://img.shields.io/badge/Claude-191919?style=for-the-badge&logo=anthropic&logoColor=white)
227
+ ![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)
228
+ ![LangChain](https://img.shields.io/badge/LangChain-121212?style=for-the-badge&logo=chainlink&logoColor=white)
229
+
230
+ </div>
231
+
232
+ ## ❓ FAQ
233
+
234
+ <details>
235
+ <summary><strong>Q: How does this relate to Issue #20179?</strong></summary>
236
+ <br>
237
+ 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.
238
+ </details>
239
+
240
+ <details>
241
+ <summary><strong>Q: How accurate are the translations?</strong></summary>
242
+ <br>
243
+ 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.
244
+ </details>
245
+
246
+ <details>
247
+ <summary><strong>Q: What permissions do I need for GitHub integration?</strong></summary>
248
+ <br>
249
+ Your GitHub token needs repository read/write permissions and the ability to create branches and pull requests on the target repository.
250
+ </details>
251
+
252
+ <details>
253
+ <summary><strong>Q: Can I customize the translation style?</strong></summary>
254
+ <br>
255
+ Yes! You can provide reference PR URLs to match existing translation patterns and maintain consistency with community standards.
256
+ </details>
257
+
258
+ ## πŸ› Troubleshooting
259
+
260
+ ### Common Issues
261
+
262
+ <details>
263
+ <summary><strong>API Key Issues</strong></summary>
264
+
265
+ - Ensure your Anthropic API key is valid and has sufficient credits
266
+ - Check that your GitHub token has the necessary repository permissions
267
+
268
+ </details>
269
+
270
+ <details>
271
+ <summary><strong>Translation Quality</strong></summary>
272
+
273
+ - The system uses Claude Sonnet 4 for high-quality translations
274
+ - Formatting and markdown structure is maintained
275
+ - Please restart the translation again if you met format issue
276
+
277
+ </details>
278
+
279
+ <details>
280
+ <summary><strong>GitHub PR Creation</strong></summary>
281
+
282
+ - Verify repository permissions and branch protection rules
283
+ - Check that the reference PR URL is accessible and valid
284
+
285
+ </details>
286
+
287
+
288
+ ## πŸ™ Acknowledgments
289
+
290
+ Special thanks to the amazing communities that make this possible:
291
+
292
+ - **πŸ€— Hugging Face** - For building the Transformers library and comprehensive documentation
293
+ - **🎭 Anthropic** - For Claude's incredible language capabilities
294
+ - **πŸ‘₯ Hugging Face KREW Community** - For championing Korean AI translation
295
+ - **🎨 Gradio** - For making beautiful AI interfaces simple
296
+ - **🌍 Community Contributors** - For raising awareness through [Issue #20179](https://github.com/huggingface/transformers/issues/20179)
297
+
298
+ ---
299
+
300
+ <div align="center">
301
+
302
+ **Made with ❀️ for global accessibility of Hugging Face Transformers documentation.**
303
+
304
+ **🎯 Solving [Issue #20179](https://github.com/huggingface/transformers/issues/20179) one translation at a time.**
305
+
306
+ [⭐ 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)
307
+
308
+ </div>