Spaces:
Configuration error
Configuration error
Create init.sh
Browse files
init.sh
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Init script for Myanmar TTS Space
|
| 4 |
+
echo "Initializing Myanmar TTS Space..."
|
| 5 |
+
|
| 6 |
+
# Clone the repository if needed
|
| 7 |
+
if [ ! -d "myanmar-tts" ]; then
|
| 8 |
+
echo "Cloning repository..."
|
| 9 |
+
git clone https://github.com/hpbyte/myanmar-tts.git
|
| 10 |
+
fi
|
| 11 |
+
|
| 12 |
+
# Create model directory if needed
|
| 13 |
+
if [ ! -d "trained_model" ]; then
|
| 14 |
+
echo "Creating model directory..."
|
| 15 |
+
mkdir -p trained_model
|
| 16 |
+
fi
|
| 17 |
+
|
| 18 |
+
# Check if model files exist
|
| 19 |
+
if [ ! -f "trained_model/checkpoint_latest.pth.tar" ] || [ ! -f "trained_model/hparams.yml" ]; then
|
| 20 |
+
echo "Creating placeholder model files..."
|
| 21 |
+
echo "This is a placeholder. Replace with actual model file." > trained_model/checkpoint_latest.pth.tar
|
| 22 |
+
echo "# This is a placeholder. Replace with actual hparams.yml" > trained_model/hparams.yml
|
| 23 |
+
|
| 24 |
+
echo "WARNING: Model files are missing. You need to upload them to the 'trained_model' directory."
|
| 25 |
+
echo "Required files:"
|
| 26 |
+
echo "1. trained_model/checkpoint_latest.pth.tar"
|
| 27 |
+
echo "2. trained_model/hparams.yml"
|
| 28 |
+
fi
|
| 29 |
+
|
| 30 |
+
# Set up Python path
|
| 31 |
+
export PYTHONPATH=$PYTHONPATH:$(pwd):$(pwd)/myanmar-tts
|
| 32 |
+
|
| 33 |
+
# Run the setup script
|
| 34 |
+
python setup_repo.py
|
| 35 |
+
|
| 36 |
+
echo "Initialization complete."
|