Instructions to use aisingapore/coherence-momentum with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aisingapore/coherence-momentum with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aisingapore/coherence-momentum") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aisingapore/coherence-momentum", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aisingapore/coherence-momentum with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aisingapore/coherence-momentum" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aisingapore/coherence-momentum", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aisingapore/coherence-momentum
- SGLang
How to use aisingapore/coherence-momentum 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 "aisingapore/coherence-momentum" \ --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": "aisingapore/coherence-momentum", "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 "aisingapore/coherence-momentum" \ --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": "aisingapore/coherence-momentum", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aisingapore/coherence-momentum with Docker Model Runner:
docker model run hf.co/aisingapore/coherence-momentum
Replaced links from sgnlp to sgnlp-models
Browse files
README.md
CHANGED
|
@@ -71,10 +71,10 @@ from sgnlp.models.coherence_momentum import CoherenceMomentumModel, CoherenceMom
|
|
| 71 |
|
| 72 |
# Load Model
|
| 73 |
config = CoherenceMomentumConfig.from_pretrained(
|
| 74 |
-
"https://storage.googleapis.com/sgnlp/models/coherence_momentum/config.json"
|
| 75 |
)
|
| 76 |
model = CoherenceMomentumModel.from_pretrained(
|
| 77 |
-
"https://storage.googleapis.com/sgnlp/models/coherence_momentum/pytorch_model.bin",
|
| 78 |
config=config
|
| 79 |
)
|
| 80 |
|
|
@@ -113,10 +113,10 @@ Please contact the authors to get the dataset if you have a valid LDC license.
|
|
| 113 |
#### Training Results
|
| 114 |
- **Training Time:** ~24 hours for ~46000 steps (batch size of 1) on a single A100 GPU
|
| 115 |
- **Datasets:** Permuted dataset derived from Linguistic Data Consortium's (LDC) Wall Street Journal (WSJ) dataset.
|
| 116 |
-
- **Training Config:** [link](https://storage.googleapis.com/sgnlp/models/coherence_momentum/config.json)
|
| 117 |
|
| 118 |
# Model Parameters
|
| 119 |
-
- **Model Weights:** [link](https://storage.googleapis.com/sgnlp/models/coherence_momentum/pytorch_model.bin)
|
| 120 |
- **Model Inputs:** A paragraph of text. During training, each positive example can be paired with one or more negative examples.
|
| 121 |
- **Model Outputs:** Coherence score for the input text.
|
| 122 |
- **Model Size:** ~930MB
|
|
|
|
| 71 |
|
| 72 |
# Load Model
|
| 73 |
config = CoherenceMomentumConfig.from_pretrained(
|
| 74 |
+
"https://storage.googleapis.com/sgnlp-models/models/coherence_momentum/config.json"
|
| 75 |
)
|
| 76 |
model = CoherenceMomentumModel.from_pretrained(
|
| 77 |
+
"https://storage.googleapis.com/sgnlp-models/models/coherence_momentum/pytorch_model.bin",
|
| 78 |
config=config
|
| 79 |
)
|
| 80 |
|
|
|
|
| 113 |
#### Training Results
|
| 114 |
- **Training Time:** ~24 hours for ~46000 steps (batch size of 1) on a single A100 GPU
|
| 115 |
- **Datasets:** Permuted dataset derived from Linguistic Data Consortium's (LDC) Wall Street Journal (WSJ) dataset.
|
| 116 |
+
- **Training Config:** [link](https://storage.googleapis.com/sgnlp-models/models/coherence_momentum/config.json)
|
| 117 |
|
| 118 |
# Model Parameters
|
| 119 |
+
- **Model Weights:** [link](https://storage.googleapis.com/sgnlp-models/models/coherence_momentum/pytorch_model.bin)
|
| 120 |
- **Model Inputs:** A paragraph of text. During training, each positive example can be paired with one or more negative examples.
|
| 121 |
- **Model Outputs:** Coherence score for the input text.
|
| 122 |
- **Model Size:** ~930MB
|