Spaces:
Runtime error
Runtime error
Peter Michael Gits
Fix Dockerfile directory permissions - create /app as root before switching users
26096f4 | #!/usr/bin/env python3 | |
| from huggingface_hub import HfApi | |
| import os | |
| # Create minimal HuggingFace Space for testing | |
| api = HfApi() | |
| try: | |
| # Create a clean README for minimal version | |
| readme_content = """--- | |
| title: STT GPU Service Python v5 - Minimal | |
| emoji: ποΈ | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: docker | |
| app_port: 7860 | |
| hardware: t4-small | |
| sleep_time_timeout: 1800 | |
| suggested_storage: small | |
| --- | |
| # ποΈ STT GPU Service Python v5 - Minimal | |
| Minimal deployment test version of the Speech-to-Text service. | |
| ## Status | |
| This is a placeholder version to test deployment infrastructure. | |
| Model loading will be added after successful deployment. | |
| ## Endpoints | |
| - `GET /` - Service info | |
| - `GET /health` - Health check | |
| - `POST /transcribe` - Placeholder | |
| - `WebSocket /ws/stream` - Placeholder | |
| """ | |
| with open('README_minimal.md', 'w') as f: | |
| f.write(readme_content) | |
| # Create the minimal space | |
| space_url = api.create_repo( | |
| repo_id="pgits/stt-gpu-service-python-v5-minimal", | |
| repo_type="space", | |
| exist_ok=True, | |
| space_sdk="docker", | |
| space_hardware="t4-small", | |
| space_sleep_time=1800 | |
| ) | |
| print(f"Minimal Space created: {space_url}") | |
| # Upload minimal files | |
| files_to_upload = [ | |
| ("app_minimal.py", "app.py"), | |
| ("requirements_minimal.txt", "requirements.txt"), | |
| ("Dockerfile_minimal", "Dockerfile"), | |
| ("README_minimal.md", "README.md") | |
| ] | |
| for local_file, repo_file in files_to_upload: | |
| if os.path.exists(local_file): | |
| print(f"Uploading {local_file} as {repo_file}...") | |
| api.upload_file( | |
| path_or_fileobj=local_file, | |
| path_in_repo=repo_file, | |
| repo_id="pgits/stt-gpu-service-python-v5-minimal", | |
| repo_type="space" | |
| ) | |
| print(f"β {repo_file} uploaded") | |
| else: | |
| print(f"β οΈ {local_file} not found") | |
| print("π Minimal Space deployment completed!") | |
| print(f"URL: https://huggingface.co/spaces/pgits/stt-gpu-service-python-v5-minimal") | |
| except Exception as e: | |
| print(f"Error: {e}") |