Update README.md (#1)
Browse files- Update README.md (e93517d4666d0fa628fb90eb566ed3d9eefab604)
Co-authored-by: Minju Jwa <[email protected]>
README.md
CHANGED
@@ -7,4 +7,303 @@ sdk: gradio
|
|
7 |
sdk_version: 5.33.1
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
sdk_version: 5.33.1
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
+
tags:
|
11 |
+
- agent-demo-track
|
12 |
+
- Agents-MCP-Hackathon
|
13 |
+
---
|
14 |
+
|
15 |
+
|
16 |
+
<div align="center">
|
17 |
+
|
18 |
+
# π [i18n-agent] Hugging Face i18n made easy
|
19 |
+
|
20 |
+
*AI-powered translation agent for Hugging Face Transformers documentation internationalization*
|
21 |
+
|
22 |
+
[](https://huggingface.co/spaces/Agents-MCP-Hackathon/hf-transformers-docs-i18n-agent)
|
23 |
+
[](https://github.com/topics/agent-demo-track)
|
24 |
+
|
25 |
+

|
26 |
+
|
27 |
+
**Streamline Hugging Face Transformers documentation translation with Claude AI**
|
28 |
+
β’ **Auto-generate GitHub PRs** β’ **Multi-language support**
|
29 |
+
|
30 |
+
> π― **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.
|
31 |
+
|
32 |
+
[π Try Live Demo](https://huggingface.co/spaces/Agents-MCP-Hackathon/hf-transformers-docs-i18n-agent) β’ [πΉ Watch Demo](#-demo-video) β’ [π Documentation](#-quick-start)
|
33 |
+
|
34 |
+
</div>
|
35 |
+
|
36 |
+
---
|
37 |
+
|
38 |
+
## β¨ What is this?
|
39 |
+
|
40 |
+
Transform the way you contribute to Hugging Face Transformers' global community! This AI agent automatically:
|
41 |
+
|
42 |
+
- π **Discovers** missing translations in [Transformers documentation](https://huggingface.co/docs/transformers/en/index)
|
43 |
+
- π€ **Translates** using Claude Sonnet 4 with technical precision
|
44 |
+
- π **Creates** GitHub pull requests ready for review on [huggingface/transformers](https://github.com/huggingface/transformers)
|
45 |
+
- π¬ **Guides** you through the entire process
|
46 |
+
|
47 |
+
> **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.
|
48 |
+
|
49 |
+
## π― Addressing the Community Need
|
50 |
+
|
51 |
+
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:
|
52 |
+
|
53 |
+
- **π§ Translation Bottlenecks**: Automates the manual translation process
|
54 |
+
- **π Consistency Issues**: Maintains uniform translation quality within each languages
|
55 |
+
- **β‘ Scalability Problems**: Handles batch translations efficiently
|
56 |
+
- **π€ Contributor Barriers**: Simplifies the PR creation workflow for translators
|
57 |
+
|
58 |
+
## π₯ Demo Video
|
59 |
+
|
60 |
+
[](https://www.youtube.com/watch?v=YOUR_VIDEO_ID)
|
61 |
+
|
62 |
+
*Watch the complete walkthrough: from setup to PR creation in under 5 minutes*
|
63 |
+
|
64 |
+
## π Quick Start
|
65 |
+
|
66 |
+

|
67 |
+
|
68 |
+
### Option 1: One-Click Demo (Recommended)
|
69 |
+
[](https://huggingface.co/spaces/YOUR_USERNAME/i18n-agent)
|
70 |
+
|
71 |
+
β
**No setup required!** Just click and start translating.
|
72 |
+
β
**Pre-requisites!** Need `Anthropic API key` and `Github token`.
|
73 |
+
|
74 |
+
### Option 2: Run Locally
|
75 |
+
|
76 |
+
<details>
|
77 |
+
<summary>π οΈ Local Installation Guide</summary>
|
78 |
+
|
79 |
+
```bash
|
80 |
+
# Clone the repo
|
81 |
+
git clone https://github.com/Hugging-Face-KREW/i18n-agent.git
|
82 |
+
cd i18n-agent
|
83 |
+
|
84 |
+
# Install dependencies
|
85 |
+
pip install -r requirements.txt
|
86 |
+
|
87 |
+
# Set up your keys
|
88 |
+
cp .env.example .env
|
89 |
+
# Add your Anthropic API key and GitHub token
|
90 |
+
|
91 |
+
# Launch the app
|
92 |
+
python app.py
|
93 |
+
```
|
94 |
+
|
95 |
+
</details>
|
96 |
+
|
97 |
+
## π― How It Works
|
98 |
+
|
99 |
+
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.
|
100 |
+
|
101 |
+
```mermaid
|
102 |
+
graph LR
|
103 |
+
A[π Find Files] --> B[π€ Translate] --> C[π Create PR]
|
104 |
+
|
105 |
+
A --> A1[Scan transformers docs]
|
106 |
+
A --> A2[Identify translation gaps]
|
107 |
+
|
108 |
+
B --> B1[Claude AI translation]
|
109 |
+
B --> B2[Preserve formatting]
|
110 |
+
|
111 |
+
C --> C1[Auto-branch creation]
|
112 |
+
C --> C2[Submit to huggingface/transformers]
|
113 |
+
```
|
114 |
+
|
115 |
+
### Step 1: π Discover Translation Targets
|
116 |
+
- Select your target language (Korean, and more languages will be supported)
|
117 |
+
- Set how many files to process
|
118 |
+
- Let AI identify the most impactful Transformers docs translations
|
119 |
+
|
120 |
+
### Step 2: π€ Smart Translation
|
121 |
+
- Enter your Anthropic API key
|
122 |
+
- Claude Sonnet 4 translates with context awareness
|
123 |
+
- Technical terms and code blocks preserved automatically
|
124 |
+
|
125 |
+
### Step 3: π Automated PR Creation
|
126 |
+
- Configure GitHub credentials
|
127 |
+
- System creates properly formatted pull requests for [huggingface/transformers](https://github.com/huggingface/transformers)
|
128 |
+
- Optional: Use reference PRs for consistency
|
129 |
+
|
130 |
+
## π Supported Languages
|
131 |
+
|
132 |
+
<div align="center">
|
133 |
+
|
134 |
+
| Language | Code | Status |
|
135 |
+
|----------|------|--------|
|
136 |
+
| π°π· Korean | `ko` | β
Fully Supported |
|
137 |
+
|
138 |
+
*And more languages coming soon...*
|
139 |
+
|
140 |
+
</div>
|
141 |
+
|
142 |
+
## ποΈ Architecture
|
143 |
+
|
144 |
+
<div align="center">
|
145 |
+
<a href="images/workflow.png" target="_blank">
|
146 |
+
<img src="images/workflow.png" alt="KREW x Hugging Face Logo" width="400">
|
147 |
+
</a>
|
148 |
+
</div>
|
149 |
+
|
150 |
+
<details>
|
151 |
+
|
152 |
+
<summary>π System Design Overview</summary>
|
153 |
+
|
154 |
+
**Frontend Layer**
|
155 |
+
- Gradio web interface with modern styling
|
156 |
+
- Real-time chat & quick controls with AI agent
|
157 |
+
- Progress tracking missing
|
158 |
+
|
159 |
+
**AI Processing Layer**
|
160 |
+
- File discovery with intelligent prioritization for Transformers docs
|
161 |
+
- Claude Sonnet 4 for context-aware translation
|
162 |
+
- LangChain integration for PR research
|
163 |
+
|
164 |
+
**Integration Layer**
|
165 |
+
- GitHub API for automated PR creation to [huggingface/transformers](https://github.com/huggingface/transformers)
|
166 |
+
- Branch management and commit structuring
|
167 |
+
- Template matching from reference PRs
|
168 |
+
|
169 |
+
</details>
|
170 |
+
|
171 |
+
## βοΈ Configuration
|
172 |
+
|
173 |
+
### For Spaces Deployment
|
174 |
+
Prepare these secrets:
|
175 |
+
|
176 |
+
```bash
|
177 |
+
ANTHROPIC_API_KEY=your_claude_api_key
|
178 |
+
GITHUB_TOKEN=your_github_token
|
179 |
+
```
|
180 |
+
|
181 |
+
### For Local Development
|
182 |
+
Create `.env` file:
|
183 |
+
|
184 |
+
```bash
|
185 |
+
ANTHROPIC_API_KEY=<your api key>
|
186 |
+
|
187 |
+
# GitHub PR Agent Configuration
|
188 |
+
GITHUB_TOKEN=<your github token>
|
189 |
+
GITHUB_OWNER=<your github username>
|
190 |
+
GITHUB_REPO=<your repository name>
|
191 |
+
REFERENCE_PR_URL=<reference pr url for style analysis>
|
192 |
+
```
|
193 |
+
|
194 |
+
## π€ Contributing
|
195 |
+
|
196 |
+
<div align="center">
|
197 |
+
|
198 |
+
**Love this project? Here's how you can help:**
|
199 |
+
|
200 |
+
[](https://github.com/Hugging-Face-KREW/i18n-agent.git)
|
201 |
+
[](https://github.com/Hugging-Face-KREW/i18n-agent.git)
|
202 |
+
[](https://github.com/Hugging-Face-KREW/i18n-agent.git)
|
203 |
+
|
204 |
+
</div>
|
205 |
+
|
206 |
+
### π₯ Contributors
|
207 |
+
|
208 |
+
π€ [email protected] / @harheem
|
209 |
+
π€ [email protected] / @Jwaminju
|
210 |
+
|
211 |
+
## π‘ Use Cases
|
212 |
+
|
213 |
+
> **π Real-world scenarios where this agent shines:**
|
214 |
+
|
215 |
+
- **π Documentation Teams**: Batch translate Transformers documentation updates
|
216 |
+
- **π Community Contributors**: Help make Transformers accessible in your language
|
217 |
+
- **π’ Organizations**: Streamline i18n workflows for Transformers library
|
218 |
+
- **π¨βπ» Developers**: Contribute Transformers translations without manual GitHub workflow
|
219 |
+
- **π― Issue #20179 Contributors**: Directly address the internationalization challenges raised by the community
|
220 |
+
|
221 |
+
## π οΈ Tech Stack
|
222 |
+
|
223 |
+
<div align="center">
|
224 |
+
|
225 |
+

|
226 |
+

|
227 |
+

|
228 |
+

|
229 |
+

|
230 |
+
|
231 |
+
</div>
|
232 |
+
|
233 |
+
## β FAQ
|
234 |
+
|
235 |
+
<details>
|
236 |
+
<summary><strong>Q: How does this relate to Issue #20179?</strong></summary>
|
237 |
+
<br>
|
238 |
+
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.
|
239 |
+
</details>
|
240 |
+
|
241 |
+
<details>
|
242 |
+
<summary><strong>Q: How accurate are the translations?</strong></summary>
|
243 |
+
<br>
|
244 |
+
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.
|
245 |
+
</details>
|
246 |
+
|
247 |
+
<details>
|
248 |
+
<summary><strong>Q: What permissions do I need for GitHub integration?</strong></summary>
|
249 |
+
<br>
|
250 |
+
Your GitHub token needs repository read/write permissions and the ability to create branches and pull requests on the target repository.
|
251 |
+
</details>
|
252 |
+
|
253 |
+
<details>
|
254 |
+
<summary><strong>Q: Can I customize the translation style?</strong></summary>
|
255 |
+
<br>
|
256 |
+
Yes! You can provide reference PR URLs to match existing translation patterns and maintain consistency with community standards.
|
257 |
+
</details>
|
258 |
+
|
259 |
+
## π Troubleshooting
|
260 |
+
|
261 |
+
### Common Issues
|
262 |
+
|
263 |
+
<details>
|
264 |
+
<summary><strong>API Key Issues</strong></summary>
|
265 |
+
|
266 |
+
- Ensure your Anthropic API key is valid and has sufficient credits
|
267 |
+
- Check that your GitHub token has the necessary repository permissions
|
268 |
+
|
269 |
+
</details>
|
270 |
+
|
271 |
+
<details>
|
272 |
+
<summary><strong>Translation Quality</strong></summary>
|
273 |
+
|
274 |
+
- The system uses Claude Sonnet 4 for high-quality translations
|
275 |
+
- Formatting and markdown structure is maintained
|
276 |
+
- Please restart the translation again if you met format issue
|
277 |
+
|
278 |
+
</details>
|
279 |
+
|
280 |
+
<details>
|
281 |
+
<summary><strong>GitHub PR Creation</strong></summary>
|
282 |
+
|
283 |
+
- Verify repository permissions and branch protection rules
|
284 |
+
- Check that the reference PR URL is accessible and valid
|
285 |
+
|
286 |
+
</details>
|
287 |
+
|
288 |
+
|
289 |
+
## π Acknowledgments
|
290 |
+
|
291 |
+
Special thanks to the amazing communities that make this possible:
|
292 |
+
|
293 |
+
- **π€ Hugging Face** - For building the Transformers library and comprehensive documentation
|
294 |
+
- **π Anthropic** - For Claude's incredible language capabilities
|
295 |
+
- **π₯ Hugging Face KREW Community** - For championing Korean AI translation
|
296 |
+
- **π¨ Gradio** - For making beautiful AI interfaces simple
|
297 |
+
- **π Community Contributors** - For raising awareness through [Issue #20179](https://github.com/huggingface/transformers/issues/20179)
|
298 |
+
|
299 |
+
---
|
300 |
+
|
301 |
+
<div align="center">
|
302 |
+
|
303 |
+
**Made with β€οΈ for global accessibility of Hugging Face Transformers documentation.**
|
304 |
+
|
305 |
+
**π― Solving [Issue #20179](https://github.com/huggingface/transformers/issues/20179) one translation at a time.**
|
306 |
+
|
307 |
+
[β 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)
|
308 |
+
|
309 |
+
</div>
|