wony617 commited on
Commit
1311a81
Β·
unverified Β·
1 Parent(s): 42d1e42

Update README.md

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