Text Generation
Transformers
Burmese
English
myanmar
burmese
llm
chat
instruction-following
conversational
autoregressive
Instructions to use amkyawdev/myanmar-ghost with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amkyawdev/myanmar-ghost with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amkyawdev/myanmar-ghost") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("amkyawdev/myanmar-ghost", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amkyawdev/myanmar-ghost with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amkyawdev/myanmar-ghost" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/myanmar-ghost", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/amkyawdev/myanmar-ghost
- SGLang
How to use amkyawdev/myanmar-ghost with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "amkyawdev/myanmar-ghost" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/myanmar-ghost", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "amkyawdev/myanmar-ghost" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/myanmar-ghost", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use amkyawdev/myanmar-ghost with Docker Model Runner:
docker model run hf.co/amkyawdev/myanmar-ghost
Add scripts
Browse files- deploy_model.sh +35 -0
- download_sample_data.sh +39 -0
- run_data_pipeline.sh +25 -0
- run_federated_server.sh +23 -0
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"
|