Text Generation
Transformers
PyTorch
English
emg
morphology
language-model
causal-lm
morpiece-tokenizer
custom_code
Instructions to use NeTS-lab/emg-10m-conv_test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NeTS-lab/emg-10m-conv_test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NeTS-lab/emg-10m-conv_test", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("NeTS-lab/emg-10m-conv_test", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use NeTS-lab/emg-10m-conv_test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NeTS-lab/emg-10m-conv_test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeTS-lab/emg-10m-conv_test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NeTS-lab/emg-10m-conv_test
- SGLang
How to use NeTS-lab/emg-10m-conv_test 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 "NeTS-lab/emg-10m-conv_test" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeTS-lab/emg-10m-conv_test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "NeTS-lab/emg-10m-conv_test" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeTS-lab/emg-10m-conv_test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NeTS-lab/emg-10m-conv_test with Docker Model Runner:
docker model run hf.co/NeTS-lab/emg-10m-conv_test
# Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("NeTS-lab/emg-10m-conv_test", trust_remote_code=True, dtype="auto")Quick Links
EMG Language Model
This is an EMG (Enhanced Morphological Generation) language model with MorPiece tokenizer.
Model Details
- Model Type: Causal Language Model
- Architecture: EMG with morphological awareness
- Tokenizer: MorPiece (morphology-aware tokenization)
- Parameters: 79.75M
- Vocabulary Size: 60001
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("your-username/your-model-name", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("your-username/your-model-name", trust_remote_code=True)
# Generate text
input_text = "The future of AI is"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=50)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_text)
Model Architecture
The EMG model uses morphological awareness for better language understanding and generation. The MorPiece tokenizer provides morphology-aware tokenization that better handles word formations.
Training
This model was trained on conversational data with morphological enhancement.
Limitations
- This model is designed for research purposes
- May not perform optimally on all downstream tasks without fine-tuning
- Requires trust_remote_code=True due to custom architecture
Citation
If you use this model, please cite the original EMG paper and implementation.
- Downloads last month
- -
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NeTS-lab/emg-10m-conv_test", trust_remote_code=True)