Instructions to use Wangtwohappy/T4_code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Wangtwohappy/T4_code 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 Wangtwohappy/T4_code:Q4_K_M # Run inference directly in the terminal: llama cli -hf Wangtwohappy/T4_code:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Wangtwohappy/T4_code:Q4_K_M # Run inference directly in the terminal: llama cli -hf Wangtwohappy/T4_code:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Wangtwohappy/T4_code:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Wangtwohappy/T4_code:Q4_K_M
Use Docker
docker model run hf.co/Wangtwohappy/T4_code:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use Wangtwohappy/T4_code with Ollama:
ollama run hf.co/Wangtwohappy/T4_code:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Wangtwohappy/T4_code with Docker Model Runner:
docker model run hf.co/Wangtwohappy/T4_code:Q4_K_M
- Lemonade
How to use Wangtwohappy/T4_code with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Wangtwohappy/T4_code:Q4_K_M
Run and chat with the model
lemonade run user.T4_code-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download vllm-deploy/gguf_template.py from Wangtwohappy/T4_code: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/Wangtwohappy/T4_code/resolve/main/vllm-deploy/gguf_template.py
- Command line
-
hf download hf://Wangtwohappy/T4_code/vllm-deploy/gguf_template.py
-
curl -L -o gguf_template.py https://huggingface.co/Wangtwohappy/T4_code/resolve/main/vllm-deploy/gguf_template.py
1.13 kB
| from vllm import LLM, SamplingParams | |
| # In this script, we demonstrate how to pass input to the chat method: | |
| conversation = [ | |
| { | |
| "role": "system", | |
| "content": "You are a helpful assistant" | |
| }, | |
| { | |
| "role": "user", | |
| "content": "Hello" | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": "Hello! How can I assist you today?" | |
| }, | |
| { | |
| "role": "user", | |
| "content": "Write an essay about the importance of higher education.", | |
| }, | |
| ] | |
| # Create a sampling params object. | |
| sampling_params = SamplingParams(temperature=0.8, top_p=0.95) | |
| # Create an LLM. | |
| llm = LLM(model="/mnt/data/xiuying/Code/vllm-deploy/MiniCPM-V-4-Q4_K_M.gguf", | |
| tokenizer="openbmb/MiniCPM-V-4", | |
| trust_remote_code=True | |
| ) | |
| # Generate texts from the prompts. The output is a list of RequestOutput objects | |
| # that contain the prompt, generated text, and other information. | |
| outputs = llm.chat(conversation, sampling_params) | |
| # Print the outputs. | |
| for output in outputs: | |
| prompt = output.prompt | |
| generated_text = output.outputs[0].text | |
| print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}") |