Spaces:
Running
Running
bravedims
commited on
Commit
·
e29fad2
1
Parent(s):
091ae7a
Fix device configuration and hardware requirements
Browse files- Update README.md to request a10g-small GPU hardware instead of t4-medium
- Fix inference.yaml to use auto device detection instead of hardcoded cuda
- Disable xformers and flash_attention for CPU compatibility
- Add device auto-detection to inference script
- This should fix the CPU/GPU mismatch causing generation failures
- README.md +2 -1
- configs/inference.yaml +4 -4
- scripts/inference.py +17 -2
README.md
CHANGED
|
@@ -6,7 +6,7 @@ colorTo: pink
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: apache-2.0
|
| 9 |
-
suggested_hardware:
|
| 10 |
suggested_storage: large
|
| 11 |
---
|
| 12 |
|
|
@@ -72,3 +72,4 @@ Apache 2.0 - See LICENSE file for details
|
|
| 72 |
*Powered by OmniAvatar-14B and ElevenLabs TTS*
|
| 73 |
|
| 74 |
**Note**: This space requires large storage capacity due to the 14B parameter models. The models are downloaded on first startup and cached for subsequent uses.
|
|
|
|
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: apache-2.0
|
| 9 |
+
suggested_hardware: a10g-small
|
| 10 |
suggested_storage: large
|
| 11 |
---
|
| 12 |
|
|
|
|
| 72 |
*Powered by OmniAvatar-14B and ElevenLabs TTS*
|
| 73 |
|
| 74 |
**Note**: This space requires large storage capacity due to the 14B parameter models. The models are downloaded on first startup and cached for subsequent uses.
|
| 75 |
+
|
configs/inference.yaml
CHANGED
|
@@ -15,16 +15,16 @@ inference:
|
|
| 15 |
duration: 5.0
|
| 16 |
|
| 17 |
hardware:
|
| 18 |
-
device: "
|
| 19 |
mixed_precision: "fp16"
|
| 20 |
-
enable_xformers:
|
| 21 |
-
enable_flash_attention:
|
| 22 |
|
| 23 |
output:
|
| 24 |
output_dir: "./outputs"
|
| 25 |
format: "mp4"
|
| 26 |
codec: "h264"
|
| 27 |
-
bitrate: "
|
| 28 |
|
| 29 |
tea_cache:
|
| 30 |
enabled: false
|
|
|
|
| 15 |
duration: 5.0
|
| 16 |
|
| 17 |
hardware:
|
| 18 |
+
device: "auto" # Auto-detect GPU/CPU
|
| 19 |
mixed_precision: "fp16"
|
| 20 |
+
enable_xformers: false # Disable for CPU
|
| 21 |
+
enable_flash_attention: false # Disable for CPU
|
| 22 |
|
| 23 |
output:
|
| 24 |
output_dir: "./outputs"
|
| 25 |
format: "mp4"
|
| 26 |
codec: "h264"
|
| 27 |
+
bitrate: "2M"
|
| 28 |
|
| 29 |
tea_cache:
|
| 30 |
enabled: false
|
scripts/inference.py
CHANGED
|
@@ -6,8 +6,22 @@ import sys
|
|
| 6 |
from pathlib import Path
|
| 7 |
import logging
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def parse_args():
|
| 13 |
parser = argparse.ArgumentParser(description="OmniAvatar-14B Inference")
|
|
@@ -75,3 +89,4 @@ def main():
|
|
| 75 |
|
| 76 |
if __name__ == "__main__":
|
| 77 |
main()
|
|
|
|
|
|
| 6 |
from pathlib import Path
|
| 7 |
import logging
|
| 8 |
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def get_device(config_device):
|
| 12 |
+
"""Auto-detect available device"""
|
| 13 |
+
if config_device == "auto":
|
| 14 |
+
if torch.cuda.is_available():
|
| 15 |
+
device = "cuda"
|
| 16 |
+
logger.info("CUDA available, using GPU")
|
| 17 |
+
else:
|
| 18 |
+
device = "cpu"
|
| 19 |
+
logger.info("CUDA not available, using CPU")
|
| 20 |
+
else:
|
| 21 |
+
device = config_device
|
| 22 |
+
logger.info(f"Using configured device: {device}")
|
| 23 |
+
|
| 24 |
+
return device
|
| 25 |
|
| 26 |
def parse_args():
|
| 27 |
parser = argparse.ArgumentParser(description="OmniAvatar-14B Inference")
|
|
|
|
| 89 |
|
| 90 |
if __name__ == "__main__":
|
| 91 |
main()
|
| 92 |
+
|