Instructions to use erfanzar/MaticGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erfanzar/MaticGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="erfanzar/MaticGPT")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("erfanzar/MaticGPT") model = AutoModelForCausalLM.from_pretrained("erfanzar/MaticGPT") - llama-cpp-python
How to use erfanzar/MaticGPT with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="erfanzar/MaticGPT", filename="MaticGPT-GGUF.Q2_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Inference
- Local Apps Settings
- llama.cpp
How to use erfanzar/MaticGPT with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf erfanzar/MaticGPT:Q4_K_M # Run inference directly in the terminal: llama cli -hf erfanzar/MaticGPT:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf erfanzar/MaticGPT:Q4_K_M # Run inference directly in the terminal: llama cli -hf erfanzar/MaticGPT:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf erfanzar/MaticGPT:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf erfanzar/MaticGPT:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf erfanzar/MaticGPT:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf erfanzar/MaticGPT:Q4_K_M
Use Docker
docker model run hf.co/erfanzar/MaticGPT:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use erfanzar/MaticGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erfanzar/MaticGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erfanzar/MaticGPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/erfanzar/MaticGPT:Q4_K_M
- SGLang
How to use erfanzar/MaticGPT 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 "erfanzar/MaticGPT" \ --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": "erfanzar/MaticGPT", "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 "erfanzar/MaticGPT" \ --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": "erfanzar/MaticGPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use erfanzar/MaticGPT with Ollama:
ollama run hf.co/erfanzar/MaticGPT:Q4_K_M
- Unsloth Studio
How to use erfanzar/MaticGPT with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for erfanzar/MaticGPT to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for erfanzar/MaticGPT to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for erfanzar/MaticGPT to start chatting
- Atomic Chat new
- Docker Model Runner
How to use erfanzar/MaticGPT with Docker Model Runner:
docker model run hf.co/erfanzar/MaticGPT:Q4_K_M
- Lemonade
How to use erfanzar/MaticGPT with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull erfanzar/MaticGPT:Q4_K_M
Run and chat with the model
lemonade run user.MaticGPT-Q4_K_M
List all available models
lemonade list
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- erfanzar/ShareGPT4
|
| 4 |
+
- HuggingFaceH4/no_robots
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
- fr
|
| 8 |
+
- es
|
| 9 |
+
- zh
|
| 10 |
+
- ru
|
| 11 |
+
metrics:
|
| 12 |
+
- accuracy
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
license: mit
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# LinguaMatic
|
| 18 |
+
|
| 19 |
+
LinguaMatic is an advanced AI model designed to handle a wide range of Natural Language Processing (NLP) tasks. With its powerful capabilities, LinguaMatic can assist with tasks such as text classification, sentiment analysis, language translation, question answering, and much more.
|
| 20 |
+
|
| 21 |
+
## EasyDel
|
| 22 |
+
|
| 23 |
+
The model is finetuned Using a custom version of UltraChat on TPU-v4 POD using [EasyDel](https://github.com/erfanzar/EasyDeL)
|
| 24 |
+
|
| 25 |
+
## Prompting Method
|
| 26 |
+
|
| 27 |
+
LinguaMatic utilizes the llama2 prompting method to generate responses. This method, named after the friendly and intelligent llama, enhances the model's ability to engage in meaningful conversations. The `prompt_model` function provided below demonstrates how the llama2 prompting method is implemented:
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
def prompt_model(
|
| 31 |
+
message: str,
|
| 32 |
+
chat_history: None | list[list[str]] = [],
|
| 33 |
+
system_prompt: str | None = None
|
| 34 |
+
) -> str:
|
| 35 |
+
do_strip = False
|
| 36 |
+
texts = [f"<s>[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n"] if system_prompt is not None else ["<s>[INST] "]
|
| 37 |
+
for user_input, response in chat_history:
|
| 38 |
+
user_input = user_input.strip() if do_strip else user_input
|
| 39 |
+
do_strip = True
|
| 40 |
+
texts.append(f'{user_input} [/INST] {response.strip()} </s><s>[INST] ')
|
| 41 |
+
message = message.strip() if do_strip else message
|
| 42 |
+
texts.append(f'{message} [/INST]')
|
| 43 |
+
return ''.join(texts)
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
The `prompt_model` function takes a `message` as input, along with the `chat_history` and `system_prompt`. It generates a formatted text that includes the system prompt, user inputs, and the current message. This approach allows LinguaMatic to maintain context and provide more coherent and context-aware responses.
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
## Contributing
|
| 50 |
+
|
| 51 |
+
We welcome contributions to enhance LinguaMatic's capabilities and improve its performance. If you encounter any issues or have suggestions for improvement, please feel free to submit a pull request or open an issue on [EasyDel](https://github.com/erfanzar/EasyDeL) GitHub repository.
|