Spaces:
Running
Running
fix daggr version
Browse files- backend_deploy.py +6 -1
- backend_parsers.py +2 -1
- backend_prompts.py +1 -1
backend_deploy.py
CHANGED
|
@@ -880,6 +880,8 @@ def deploy_to_huggingface_space(
|
|
| 880 |
(temp_path / "requirements.txt").write_text("gradio>=4.0.0\n", encoding='utf-8')
|
| 881 |
elif language == "streamlit":
|
| 882 |
(temp_path / "requirements.txt").write_text("streamlit>=1.30.0\n", encoding='utf-8')
|
|
|
|
|
|
|
| 883 |
|
| 884 |
# Create Dockerfile if needed
|
| 885 |
if sdk == "docker":
|
|
@@ -938,7 +940,10 @@ def deploy_to_huggingface_space(
|
|
| 938 |
print(f"[Deploy] Generated requirements.txt with {len(requirements_content.splitlines())} lines")
|
| 939 |
else:
|
| 940 |
# Fallback to minimal requirements if no app file found
|
| 941 |
-
|
|
|
|
|
|
|
|
|
|
| 942 |
|
| 943 |
# Don't create README - HuggingFace will auto-generate it
|
| 944 |
# We'll add the anycoder tag after deployment
|
|
|
|
| 880 |
(temp_path / "requirements.txt").write_text("gradio>=4.0.0\n", encoding='utf-8')
|
| 881 |
elif language == "streamlit":
|
| 882 |
(temp_path / "requirements.txt").write_text("streamlit>=1.30.0\n", encoding='utf-8')
|
| 883 |
+
elif language == "daggr":
|
| 884 |
+
(temp_path / "requirements.txt").write_text("daggr>=0.5.4\ngradio>=6.0.2\n", encoding='utf-8')
|
| 885 |
|
| 886 |
# Create Dockerfile if needed
|
| 887 |
if sdk == "docker":
|
|
|
|
| 940 |
print(f"[Deploy] Generated requirements.txt with {len(requirements_content.splitlines())} lines")
|
| 941 |
else:
|
| 942 |
# Fallback to minimal requirements if no app file found
|
| 943 |
+
if language == "daggr":
|
| 944 |
+
(temp_path / "requirements.txt").write_text("daggr>=0.5.4\ngradio>=6.0.2\n", encoding='utf-8')
|
| 945 |
+
else:
|
| 946 |
+
(temp_path / "requirements.txt").write_text("gradio>=4.0.0\n", encoding='utf-8')
|
| 947 |
|
| 948 |
# Don't create README - HuggingFace will auto-generate it
|
| 949 |
# We'll add the anycoder tag after deployment
|
backend_parsers.py
CHANGED
|
@@ -387,6 +387,7 @@ Instructions:
|
|
| 387 |
- IMPORTANT: For diffusers, ALWAYS use: git+https://github.com/huggingface/diffusers
|
| 388 |
- IMPORTANT: For transformers, ALWAYS use: git+https://github.com/huggingface/transformers
|
| 389 |
- IMPORTANT: If diffusers is installed, also include transformers and sentencepiece as they usually go together
|
|
|
|
| 390 |
- Examples of comprehensive dependencies:
|
| 391 |
* diffusers often needs: git+https://github.com/huggingface/transformers, sentencepiece, accelerate, torch, tokenizers
|
| 392 |
* transformers often needs: accelerate, torch, tokenizers, datasets
|
|
@@ -397,7 +398,7 @@ Instructions:
|
|
| 397 |
* streamlit often needs: pandas, numpy, requests
|
| 398 |
* opencv-python often needs: numpy, pillow
|
| 399 |
* fastapi often needs: uvicorn, pydantic
|
| 400 |
-
* daggr often needs: daggr, gradio>=6.0, pydub
|
| 401 |
* torch often needs: torchvision, torchaudio (if doing computer vision/audio)
|
| 402 |
- Include packages for common file formats if relevant (openpyxl, python-docx, PyPDF2)
|
| 403 |
- Do not include Python built-in modules
|
|
|
|
| 387 |
- IMPORTANT: For diffusers, ALWAYS use: git+https://github.com/huggingface/diffusers
|
| 388 |
- IMPORTANT: For transformers, ALWAYS use: git+https://github.com/huggingface/transformers
|
| 389 |
- IMPORTANT: If diffusers is installed, also include transformers and sentencepiece as they usually go together
|
| 390 |
+
- IMPORTANT: For daggr, ALWAYS use: daggr>=0.5.4
|
| 391 |
- Examples of comprehensive dependencies:
|
| 392 |
* diffusers often needs: git+https://github.com/huggingface/transformers, sentencepiece, accelerate, torch, tokenizers
|
| 393 |
* transformers often needs: accelerate, torch, tokenizers, datasets
|
|
|
|
| 398 |
* streamlit often needs: pandas, numpy, requests
|
| 399 |
* opencv-python often needs: numpy, pillow
|
| 400 |
* fastapi often needs: uvicorn, pydantic
|
| 401 |
+
* daggr often needs: daggr>=0.5.4, gradio>=6.0, pydub
|
| 402 |
* torch often needs: torchvision, torchaudio (if doing computer vision/audio)
|
| 403 |
- Include packages for common file formats if relevant (openpyxl, python-docx, PyPDF2)
|
| 404 |
- Do not include Python built-in modules
|
backend_prompts.py
CHANGED
|
@@ -607,7 +607,7 @@ summarizer = FnNode(
|
|
| 607 |
Daggr apps launch with `graph.launch()`. For deployment to Spaces, they act like standard Gradio apps.
|
| 608 |
|
| 609 |
## Requirements:
|
| 610 |
-
1. ALWAYS generate a complete `app.py` and `requirements.txt` (via imports).
|
| 611 |
2. Organize workflow logically with clear node names.
|
| 612 |
3. Use `GradioNode` or `InferenceNode` when possible for parallel execution.
|
| 613 |
4. Always include "Built with anycoder" in the header.
|
|
|
|
| 607 |
Daggr apps launch with `graph.launch()`. For deployment to Spaces, they act like standard Gradio apps.
|
| 608 |
|
| 609 |
## Requirements:
|
| 610 |
+
1. ALWAYS generate a complete `app.py` and `requirements.txt` (via imports). In `requirements.txt`, ALWAYS use `daggr>=0.5.4` and `gradio>=6.0.2`.
|
| 611 |
2. Organize workflow logically with clear node names.
|
| 612 |
3. Use `GradioNode` or `InferenceNode` when possible for parallel execution.
|
| 613 |
4. Always include "Built with anycoder" in the header.
|