Upload scripts/run.py with huggingface_hub
Browse files- scripts/run.py +49 -0
scripts/run.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
"""
|
| 3 |
+
DiffusionGemma Humanizer — Modal Pipeline Launcher
|
| 4 |
+
==================================================
|
| 5 |
+
Runs the full pipeline on a single A100 80GB via Modal.
|
| 6 |
+
|
| 7 |
+
PREREQUISITES (one-time setup):
|
| 8 |
+
pip install modal
|
| 9 |
+
modal setup
|
| 10 |
+
modal secret create hf-secrets HF_TOKEN=hf_your_token
|
| 11 |
+
|
| 12 |
+
USAGE:
|
| 13 |
+
python scripts/run.py
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
import subprocess
|
| 17 |
+
import sys
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def main():
|
| 21 |
+
print()
|
| 22 |
+
print("=" * 64)
|
| 23 |
+
print(" DiffusionGemma Humanizer — SOTA Text Humanization")
|
| 24 |
+
print(" GPU: Single A100 80GB | Platform: Modal")
|
| 25 |
+
print("=" * 64)
|
| 26 |
+
print()
|
| 27 |
+
print("[RUN] Deploying full pipeline to Modal...")
|
| 28 |
+
print()
|
| 29 |
+
|
| 30 |
+
result = subprocess.run(["modal", "run", "modal_project/app.py::run_full_pipeline"])
|
| 31 |
+
|
| 32 |
+
if result.returncode != 0:
|
| 33 |
+
print()
|
| 34 |
+
print("[FAIL] Pipeline failed. Check error above.")
|
| 35 |
+
print(" Common fixes:")
|
| 36 |
+
print(" 1. modal account show (check balance)")
|
| 37 |
+
print(" 2. modal secret create hf-secrets HF_TOKEN=hf_your_token")
|
| 38 |
+
print(" 3. Verify token has 'Write' permission")
|
| 39 |
+
sys.exit(1)
|
| 40 |
+
|
| 41 |
+
print()
|
| 42 |
+
print("=" * 64)
|
| 43 |
+
print(" Pipeline complete!")
|
| 44 |
+
print(" Results in Modal volume: /data/output")
|
| 45 |
+
print("=" * 64)
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
if __name__ == "__main__":
|
| 49 |
+
main()
|