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 upload_to_huggingface.py
Browse files- upload_to_huggingface.py +120 -0
upload_to_huggingface.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Upload Myanmar Ghost project to HuggingFace Hub.
|
| 3 |
+
|
| 4 |
+
Usage:
|
| 5 |
+
python upload_to_huggingface.py --repo_id amkyawdev/myanmar-ghost
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
import argparse
|
| 9 |
+
import os
|
| 10 |
+
import sys
|
| 11 |
+
from pathlib import Path
|
| 12 |
+
|
| 13 |
+
# Add src to path for imports
|
| 14 |
+
sys.path.insert(0, str(Path(__file__).parent))
|
| 15 |
+
|
| 16 |
+
from huggingface_hub import HfApi, create_repo, upload_folder
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def upload_to_huggingface(
|
| 20 |
+
repo_id: str,
|
| 21 |
+
local_path: str = ".",
|
| 22 |
+
commit_message: str = "Initial upload: Myanmar Ghost project",
|
| 23 |
+
token: str = None,
|
| 24 |
+
):
|
| 25 |
+
"""Upload project to HuggingFace Hub."""
|
| 26 |
+
|
| 27 |
+
api = HfApi()
|
| 28 |
+
|
| 29 |
+
# Get token from env if not provided
|
| 30 |
+
if token is None:
|
| 31 |
+
token = os.environ.get("HF_TOKEN")
|
| 32 |
+
|
| 33 |
+
if token is None:
|
| 34 |
+
raise ValueError(
|
| 35 |
+
"HF_TOKEN not found. Please set HF_TOKEN environment variable:\n"
|
| 36 |
+
"export HF_TOKEN=hf_xxxx\n"
|
| 37 |
+
"Or get your token from: https://huggingface.co/settings/tokens"
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
print(f"🔄 Uploading to https://huggingface.co/{repo_id}")
|
| 41 |
+
|
| 42 |
+
# Create repo if doesn't exist
|
| 43 |
+
try:
|
| 44 |
+
create_repo(
|
| 45 |
+
repo_id=repo_id,
|
| 46 |
+
repo_type="space",
|
| 47 |
+
exist_ok=True,
|
| 48 |
+
token=token,
|
| 49 |
+
)
|
| 50 |
+
print(f"✅ Repository created/verified: {repo_id}")
|
| 51 |
+
except Exception as e:
|
| 52 |
+
print(f"⚠️ Could not create Space repo: {e}")
|
| 53 |
+
print(" Creating as model repo instead...")
|
| 54 |
+
create_repo(
|
| 55 |
+
repo_id=repo_id,
|
| 56 |
+
repo_type="model",
|
| 57 |
+
exist_ok=True,
|
| 58 |
+
token=token,
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
# Files/folders to upload
|
| 62 |
+
upload_items = [
|
| 63 |
+
("src", "src"),
|
| 64 |
+
("configs", "configs"),
|
| 65 |
+
("scripts", "scripts"),
|
| 66 |
+
("docs", "docs"),
|
| 67 |
+
("tests", "tests"),
|
| 68 |
+
("notebooks", "notebooks"),
|
| 69 |
+
("deployment", "deployment"),
|
| 70 |
+
("README.md", "README.md"),
|
| 71 |
+
("README_my.md", "README_my.md"),
|
| 72 |
+
("requirements.txt", "requirements.txt"),
|
| 73 |
+
("requirements_dev.txt", "requirements_dev.txt"),
|
| 74 |
+
("setup.py", "setup.py"),
|
| 75 |
+
("pyproject.toml", "pyproject.toml"),
|
| 76 |
+
(".gitignore", ".gitignore"),
|
| 77 |
+
]
|
| 78 |
+
|
| 79 |
+
# Upload each folder/file
|
| 80 |
+
for local_item, repo_item in upload_items:
|
| 81 |
+
local_path_item = Path(local_path) / local_item
|
| 82 |
+
if local_path_item.exists():
|
| 83 |
+
print(f"📤 Uploading: {local_item}")
|
| 84 |
+
try:
|
| 85 |
+
api.upload_folder(
|
| 86 |
+
folder_path=str(local_path_item),
|
| 87 |
+
repo_id=repo_id,
|
| 88 |
+
repo_type="model",
|
| 89 |
+
commit_message=f"Upload {local_item}",
|
| 90 |
+
token=token,
|
| 91 |
+
)
|
| 92 |
+
print(f" ✅ Uploaded: {local_item}")
|
| 93 |
+
except Exception as e:
|
| 94 |
+
print(f" ❌ Failed: {e}")
|
| 95 |
+
|
| 96 |
+
print(f"\n🎉 Successfully uploaded to https://huggingface.co/{repo_id}")
|
| 97 |
+
print(f"\nView your repo at: https://huggingface.co/{repo_id}/tree/main")
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
if __name__ == "__main__":
|
| 101 |
+
parser = argparse.ArgumentParser(description="Upload Myanmar Ghost to HuggingFace")
|
| 102 |
+
parser.add_argument(
|
| 103 |
+
"--repo_id",
|
| 104 |
+
type=str,
|
| 105 |
+
default="amkyawdev/myanmar-ghost",
|
| 106 |
+
help="HuggingFace repository ID (default: amkyawdev/myanmar-ghost)"
|
| 107 |
+
)
|
| 108 |
+
parser.add_argument(
|
| 109 |
+
"--token",
|
| 110 |
+
type=str,
|
| 111 |
+
default=None,
|
| 112 |
+
help="HuggingFace token (or set HF_TOKEN env variable)"
|
| 113 |
+
)
|
| 114 |
+
|
| 115 |
+
args = parser.parse_args()
|
| 116 |
+
|
| 117 |
+
upload_to_huggingface(
|
| 118 |
+
repo_id=args.repo_id,
|
| 119 |
+
token=args.token,
|
| 120 |
+
)
|