amkyawdev commited on
Commit
7dcec51
Β·
verified Β·
1 Parent(s): 12b35a0

Add scripts

Browse files
deploy_model.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Deploy Myanmar Ghost model
4
+
5
+ set -e
6
+
7
+ echo "πŸš€ Starting model deployment..."
8
+
9
+ # Parse arguments
10
+ MODEL_PATH=${1:-"outputs/models/best_model.pt"}
11
+ OUTPUT_DIR=${2:-"outputs/deployment"}
12
+ FORMAT=${3:-"safetensors"}
13
+ HUB_REPO=${4:-""}
14
+
15
+ # Activate virtual environment if exists
16
+ if [ -d "venv" ]; then
17
+ source venv/bin/activate
18
+ fi
19
+
20
+ # Install deployment dependencies
21
+ pip install -q safetensors huggingface_hub
22
+
23
+ # Run deployment pipeline
24
+ python -m src.pipelines.deployment_pipeline \
25
+ --model_path "$MODEL_PATH" \
26
+ --output_dir "$OUTPUT_DIR" \
27
+ --format "$FORMAT" \
28
+ ${HUB_REPO:+--push_hub --repo_id "$HUB_REPO"}
29
+
30
+ echo "βœ… Deployment complete!"
31
+ echo "Model exported to: $OUTPUT_DIR"
32
+
33
+ if [ -n "$HUB_REPO" ]; then
34
+ echo "Pushed to: https://huggingface.co/$HUB_REPO"
35
+ fi
download_sample_data.sh ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Download sample data for Myanmar Ghost project
4
+
5
+ set -e
6
+
7
+ echo "πŸ“₯ Downloading sample data..."
8
+
9
+ # Create data directories
10
+ mkdir -p data/raw/audio
11
+ mkdir -p data/raw/transcripts
12
+ mkdir -p data/processed
13
+
14
+ # Download sample audio (placeholder - replace with actual URLs)
15
+ # Example: wget -O data/raw/audio/sample.wav "https://example.com/sample.wav"
16
+
17
+ # Create sample metadata
18
+ cat > data/raw/metadata.csv << 'EOF'
19
+ id,audio_file,transcript,sentiment
20
+ utt_001,session_001/speaker_a.wav,α€™α€„α€Ία€Ήα€‚α€œα€¬α€•α€«,neutral
21
+ utt_002,session_001/speaker_b.wav,ကျေးဇူးပါ,positive
22
+ utt_003,session_002/speaker_a.wav,မကျေနပ်ပါဗျ,negative
23
+ EOF
24
+
25
+ # Download sample from HuggingFace datasets (if datasets is installed)
26
+ if command -v python &> /dev/null; then
27
+ python -c "
28
+ from datasets import load_dataset
29
+ # Load a sample dataset
30
+ print('Sample data structure created successfully')
31
+ "
32
+ fi
33
+
34
+ echo "βœ… Sample data downloaded to data/raw/"
35
+ echo ""
36
+ echo "Next steps:"
37
+ echo " 1. Add your actual audio files to data/raw/audio/"
38
+ echo " 2. Update transcripts in data/raw/metadata.csv"
39
+ echo " 3. Run: bash scripts/run_data_pipeline.sh"
run_data_pipeline.sh ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Run data processing pipeline
4
+
5
+ set -e
6
+
7
+ echo "πŸ”„ Starting data processing pipeline..."
8
+
9
+ # Activate virtual environment if exists
10
+ if [ -d "venv" ]; then
11
+ source venv/bin/activate
12
+ fi
13
+
14
+ # Install dependencies if needed
15
+ if [ -f "requirements.txt" ]; then
16
+ pip install -q -r requirements.txt
17
+ fi
18
+
19
+ # Run data pipeline
20
+ python -m src.pipelines.data_pipeline \
21
+ --input data/raw/metadata.csv \
22
+ --output data/processed
23
+
24
+ echo "βœ… Data pipeline complete!"
25
+ echo "Processed data saved to data/processed/"
run_federated_server.sh ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Start Federated Learning Server
4
+
5
+ set -e
6
+
7
+ echo "πŸš€ Starting Federated Learning Server..."
8
+
9
+ # Activate virtual environment if exists
10
+ if [ -d "venv" ]; then
11
+ source venv/bin/activate
12
+ fi
13
+
14
+ # Default config
15
+ CONFIG=${1:-configs/federated/server_config.yaml}
16
+
17
+ # Start server
18
+ python -m src.federated.server \
19
+ --config "$CONFIG" \
20
+ --address "[::]:8080" \
21
+ --rounds 5
22
+
23
+ echo "βœ… Federated server started on port 8080"