Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1228,6 +1228,36 @@ pinned: false
|
|
| 1228 |
|
| 1229 |
except Exception as e:
|
| 1230 |
error_msg = str(e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1231 |
yield f" ⚠️ Attempt {attempt + 1} failed: {error_msg[:100]}..."
|
| 1232 |
if attempt < 2:
|
| 1233 |
yield " Retrying in 5 seconds..."
|
|
@@ -1463,6 +1493,20 @@ with gr.Blocks(css=css) as demo:
|
|
| 1463 |
Ready to clone repositories to your Hugging Face account.
|
| 1464 |
</div>
|
| 1465 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1466 |
|
| 1467 |
with gr.Row():
|
| 1468 |
with gr.Column():
|
|
|
|
| 1228 |
|
| 1229 |
except Exception as e:
|
| 1230 |
error_msg = str(e)
|
| 1231 |
+
|
| 1232 |
+
# Rate limit 에러 처리
|
| 1233 |
+
if "429" in error_msg or "Too Many Requests" in error_msg:
|
| 1234 |
+
yield f"""
|
| 1235 |
+
❌ **Rate Limit Error**
|
| 1236 |
+
|
| 1237 |
+
You have reached the HuggingFace API rate limit for creating Spaces.
|
| 1238 |
+
|
| 1239 |
+
**What this means:**
|
| 1240 |
+
- New users have limited Space creation quotas
|
| 1241 |
+
- You need to wait before creating more Spaces (usually 17-24 hours)
|
| 1242 |
+
- Your limits will increase over time as you use HuggingFace
|
| 1243 |
+
|
| 1244 |
+
**Solutions:**
|
| 1245 |
+
1. **Wait**: Try again in 17-24 hours
|
| 1246 |
+
2. **Use existing Space**: Update an existing Space instead of creating a new one
|
| 1247 |
+
3. **Contact HuggingFace**: Email website@huggingface.co if you need immediate access
|
| 1248 |
+
4. **Alternative**: Create the Space manually on HuggingFace and upload the files
|
| 1249 |
+
|
| 1250 |
+
**Manual Space Creation Steps:**
|
| 1251 |
+
1. Go to https://huggingface.co/new-space
|
| 1252 |
+
2. Create a Space named: `{repo_hf}`
|
| 1253 |
+
3. Select SDK: {sdk_type}
|
| 1254 |
+
4. After creation, use the "Files" tab to upload your repository contents
|
| 1255 |
+
|
| 1256 |
+
Repository has been cloned to local folder and is ready for manual upload.
|
| 1257 |
+
"""
|
| 1258 |
+
# Rate limit의 경우 재시도하지 않음
|
| 1259 |
+
raise Exception(f"Rate limit reached. Please try again later or create the Space manually.")
|
| 1260 |
+
|
| 1261 |
yield f" ⚠️ Attempt {attempt + 1} failed: {error_msg[:100]}..."
|
| 1262 |
if attempt < 2:
|
| 1263 |
yield " Retrying in 5 seconds..."
|
|
|
|
| 1493 |
Ready to clone repositories to your Hugging Face account.
|
| 1494 |
</div>
|
| 1495 |
""")
|
| 1496 |
+
|
| 1497 |
+
# Rate limit 경고 추가
|
| 1498 |
+
gr.Markdown("""
|
| 1499 |
+
<div class="warning-box">
|
| 1500 |
+
<strong>⚠️ Rate Limits for New Users</strong><br>
|
| 1501 |
+
New HuggingFace users have limited Space creation quotas:
|
| 1502 |
+
<ul>
|
| 1503 |
+
<li>You can create only a few Spaces per day initially</li>
|
| 1504 |
+
<li>Limits increase over time with account activity</li>
|
| 1505 |
+
<li>If you hit the limit, wait 17-24 hours or update existing Spaces</li>
|
| 1506 |
+
<li>Contact website@huggingface.co for immediate access needs</li>
|
| 1507 |
+
</ul>
|
| 1508 |
+
</div>
|
| 1509 |
+
""")
|
| 1510 |
|
| 1511 |
with gr.Row():
|
| 1512 |
with gr.Column():
|