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", dtype="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
| """Test verification module.""" | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).parent.parent)) | |
| from src.annotation.automatic_verifier import ( | |
| AutomaticVerifier, | |
| TextLengthRule, | |
| SentimentConsistencyRule, | |
| ) | |
| def test_verifier_init(): | |
| """Test verifier initialization.""" | |
| verifier = AutomaticVerifier() | |
| assert len(verifier.rules) > 0 | |
| print("β Verifier init test passed") | |
| def test_text_length_rule(): | |
| """Test text length verification rule.""" | |
| rule = TextLengthRule(min_length=5, max_length=100) | |
| # Test too short | |
| passed, msg = rule.verify({"text": "Hi"}) | |
| assert not passed | |
| # Test valid | |
| passed, msg = rule.verify({"text": "Valid length text"}) | |
| assert passed | |
| print("β Text length rule test passed") | |
| def test_sentiment_consistency(): | |
| """Test sentiment consistency rule.""" | |
| rule = SentimentConsistencyRule() | |
| # Positive text with positive label | |
| passed, msg = rule.verify({ | |
| "text": "αα»α±αΈαα°αΈαα«", | |
| "sentiment": "positive", | |
| }) | |
| assert passed | |
| print("β Sentiment consistency rule test passed") | |
| def test_dataset_verification(): | |
| """Test full dataset verification.""" | |
| verifier = AutomaticVerifier() | |
| samples = [ | |
| {"id": "utt_001", "text": "αα»α±αΈαα°αΈαα«", "sentiment": "positive"}, | |
| {"id": "utt_002", "text": "ααα»α±αααΊ", "sentiment": "negative"}, | |
| ] | |
| results = verifier.verify_dataset(samples) | |
| assert results["total_samples"] == 2 | |
| assert "statistics" in results | |
| print("β Dataset verification test passed") | |
| def test_sample_filtering(): | |
| """Test sample filtering based on verification.""" | |
| verifier = AutomaticVerifier() | |
| samples = [ | |
| {"id": "utt_001", "text": "αα»α±αΈαα°αΈαα«", "sentiment": "positive"}, | |
| {"id": "utt_002", "text": "", "sentiment": "negative"}, # Invalid | |
| ] | |
| kept, removed = verifier.filter_samples(samples) | |
| assert len(kept) == 1 | |
| assert len(removed) == 1 | |
| print("β Sample filtering test passed") | |
| if __name__ == "__main__": | |
| test_verifier_init() | |
| test_text_length_rule() | |
| test_sentiment_consistency() | |
| test_dataset_verification() | |
| test_sample_filtering() | |
| print("\nβ All verifier tests passed!") | |