Instructions to use normalcomputing/extended-mind-mpt-30b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use normalcomputing/extended-mind-mpt-30b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="normalcomputing/extended-mind-mpt-30b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("normalcomputing/extended-mind-mpt-30b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use normalcomputing/extended-mind-mpt-30b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "normalcomputing/extended-mind-mpt-30b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "normalcomputing/extended-mind-mpt-30b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/normalcomputing/extended-mind-mpt-30b
- SGLang
How to use normalcomputing/extended-mind-mpt-30b 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 "normalcomputing/extended-mind-mpt-30b" \ --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": "normalcomputing/extended-mind-mpt-30b", "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 "normalcomputing/extended-mind-mpt-30b" \ --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": "normalcomputing/extended-mind-mpt-30b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use normalcomputing/extended-mind-mpt-30b with Docker Model Runner:
docker model run hf.co/normalcomputing/extended-mind-mpt-30b
Update README.md
Browse files
README.md
CHANGED
|
@@ -27,10 +27,10 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 27 |
|
| 28 |
ag_wiki_entry = """Alexander Grothendieck (/ˈɡroʊtəndiːk/; German pronunciation: [ˌalɛˈksandɐ ˈɡʁoːtn̩ˌdiːk] (listen); French: [ɡʁɔtɛndik]; 28 March 1928 – 13 November 2014) was a stateless (and then, since 1971, French) mathematician who became the leading figure in the creation of modern algebraic geometry.[7][8] His research extended the scope of the field and added elements of commutative algebra, homological algebra, sheaf theory, and category theory to its foundations, while his so-called "relative" perspective led to revolutionary advances in many areas of pure mathematics.[7][9] He is considered by many to be the greatest mathematician of the twentieth century.[10][11]"""
|
| 29 |
|
| 30 |
-
tokenizer_hf = AutoTokenizer.from_pretrained("normalcomputing/extended-mind-
|
| 31 |
memories = tokenizer_hf(ag_wiki_entry).input_ids
|
| 32 |
|
| 33 |
-
model_hf = AutoModelForCausalLM.from_pretrained("normalcomputing/extended-mind-
|
| 34 |
```
|
| 35 |
After this, you can generate text with the model as usual. The model will automatically use the memories during generation. You can update any config parameters (we set `topk` below) by passing new values to the `model.generate()` method.
|
| 36 |
|
|
|
|
| 27 |
|
| 28 |
ag_wiki_entry = """Alexander Grothendieck (/ˈɡroʊtəndiːk/; German pronunciation: [ˌalɛˈksandɐ ˈɡʁoːtn̩ˌdiːk] (listen); French: [ɡʁɔtɛndik]; 28 March 1928 – 13 November 2014) was a stateless (and then, since 1971, French) mathematician who became the leading figure in the creation of modern algebraic geometry.[7][8] His research extended the scope of the field and added elements of commutative algebra, homological algebra, sheaf theory, and category theory to its foundations, while his so-called "relative" perspective led to revolutionary advances in many areas of pure mathematics.[7][9] He is considered by many to be the greatest mathematician of the twentieth century.[10][11]"""
|
| 29 |
|
| 30 |
+
tokenizer_hf = AutoTokenizer.from_pretrained("normalcomputing/extended-mind-mpt-30b")
|
| 31 |
memories = tokenizer_hf(ag_wiki_entry).input_ids
|
| 32 |
|
| 33 |
+
model_hf = AutoModelForCausalLM.from_pretrained("normalcomputing/extended-mind-mpt-30b", external_memories=memories, trust_remote_code=True)
|
| 34 |
```
|
| 35 |
After this, you can generate text with the model as usual. The model will automatically use the memories during generation. You can update any config parameters (we set `topk` below) by passing new values to the `model.generate()` method.
|
| 36 |
|