Instructions to use CardinalOperations/ORLM-LLaMA-3-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CardinalOperations/ORLM-LLaMA-3-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CardinalOperations/ORLM-LLaMA-3-8B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CardinalOperations/ORLM-LLaMA-3-8B") model = AutoModelForCausalLM.from_pretrained("CardinalOperations/ORLM-LLaMA-3-8B") - Inference
- Local Apps Settings
- vLLM
How to use CardinalOperations/ORLM-LLaMA-3-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CardinalOperations/ORLM-LLaMA-3-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CardinalOperations/ORLM-LLaMA-3-8B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CardinalOperations/ORLM-LLaMA-3-8B
- SGLang
How to use CardinalOperations/ORLM-LLaMA-3-8B 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 "CardinalOperations/ORLM-LLaMA-3-8B" \ --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": "CardinalOperations/ORLM-LLaMA-3-8B", "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 "CardinalOperations/ORLM-LLaMA-3-8B" \ --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": "CardinalOperations/ORLM-LLaMA-3-8B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CardinalOperations/ORLM-LLaMA-3-8B with Docker Model Runner:
docker model run hf.co/CardinalOperations/ORLM-LLaMA-3-8B
Add library_name and pipeline_tag, correct license
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
---
|
| 2 |
license: llama3
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
| 4 |
see our paper in https://arxiv.org/abs/2405.17743
|
| 5 |
|
| 6 |
github repo: https://github.com/Cardinal-Operations/ORLM
|
|
@@ -31,7 +34,7 @@ Please replace the `{Question}` with any natural language OR question.
|
|
| 31 |
Below is an operations research question. Build a mathematical model and corresponding python code using `coptpy` that appropriately addresses the question.
|
| 32 |
|
| 33 |
# Question:
|
| 34 |
-
A lab has 1000 units of medicinal ingredients to make two pills, a large pill and a small pill. A large pill requires 3 units of medicinal ingredients and 2 units of filler. A small pill requires 2 units of medicinal ingredients and 1 unit of filler. The lab has to make at least 100 large pills. However, since small pills are more popular at least 60% of the total number of pills must be small. How many of each should be made to minimize the total number of filler material needed?
|
| 35 |
|
| 36 |
# Response:
|
| 37 |
--------------------------top-1 completion output by LLaMA-3-8B-ORLM under greedy decoding--------------------------
|
|
@@ -59,7 +62,7 @@ Using this model, we can apply linear programming techniques to find the optimal
|
|
| 59 |
## Python Code Solution Using `coptpy`:
|
| 60 |
Here is a Python script using the `coptpy` library to solve the problem:
|
| 61 |
|
| 62 |
-
|
| 63 |
import coptpy as cp
|
| 64 |
from coptpy import COPT
|
| 65 |
|
|
@@ -91,7 +94,7 @@ if model.status == COPT.OPTIMAL:
|
|
| 91 |
print("Number of small pills to be made: {:.0f}".format(y.x))
|
| 92 |
else:
|
| 93 |
print("No optimal solution found.")
|
| 94 |
-
|
| 95 |
|
| 96 |
In this script, we first create a `COPT` environment and model. Then, we add two integer decision variables `x` and `y`, representing the number of large and small pills to be made, respectively.
|
| 97 |
|
|
|
|
| 1 |
---
|
| 2 |
license: llama3
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
---
|
| 6 |
+
|
| 7 |
see our paper in https://arxiv.org/abs/2405.17743
|
| 8 |
|
| 9 |
github repo: https://github.com/Cardinal-Operations/ORLM
|
|
|
|
| 34 |
Below is an operations research question. Build a mathematical model and corresponding python code using `coptpy` that appropriately addresses the question.
|
| 35 |
|
| 36 |
# Question:
|
| 37 |
+
A lab has 1000 units of medicinal ingredients to make two pills, a large pill and a small pill. A large pill requires 3 units of medicinal ingredients and 2 units of filler. A large pill requires 3 units of medicinal ingredients and 2 units of filler. A small pill requires 2 units of medicinal ingredients and 1 unit of filler. The lab has to make at least 100 large pills. However, since small pills are more popular at least 60% of the total number of pills must be small. How many of each should be made to minimize the total number of filler material needed?
|
| 38 |
|
| 39 |
# Response:
|
| 40 |
--------------------------top-1 completion output by LLaMA-3-8B-ORLM under greedy decoding--------------------------
|
|
|
|
| 62 |
## Python Code Solution Using `coptpy`:
|
| 63 |
Here is a Python script using the `coptpy` library to solve the problem:
|
| 64 |
|
| 65 |
+
```python
|
| 66 |
import coptpy as cp
|
| 67 |
from coptpy import COPT
|
| 68 |
|
|
|
|
| 94 |
print("Number of small pills to be made: {:.0f}".format(y.x))
|
| 95 |
else:
|
| 96 |
print("No optimal solution found.")
|
| 97 |
+
```
|
| 98 |
|
| 99 |
In this script, we first create a `COPT` environment and model. Then, we add two integer decision variables `x` and `y`, representing the number of large and small pills to be made, respectively.
|
| 100 |
|