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
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 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/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 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
- LM Studio
- Jan
- Ollama
How to use Wangtwohappy/T4_code with Ollama:
ollama run hf.co/Wangtwohappy/T4_code:Q4_K_M
- Unsloth Studio
How to use Wangtwohappy/T4_code 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 Wangtwohappy/T4_code 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 Wangtwohappy/T4_code to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Wangtwohappy/T4_code to start chatting
- 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
| import os | |
| import subprocess | |
| import sys | |
| import argparse | |
| import json | |
| import time | |
| from tqdm import tqdm | |
| output_dir = "/mnt/data/xiuying/Code/local_deploy/output_0821" | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--model", type=str, default="LFM") | |
| args = parser.parse_args() | |
| output_dir = os.path.join(output_dir, args.model) | |
| os.makedirs(output_dir, exist_ok=True) | |
| VIDEO_FILE_DIR = "/mnt/data/xiuying/Code/local_deploy/video/new/Clips_60s" | |
| # API服务器的URL | |
| API_URL = "http://127.0.0.1:8010/video-inference/" | |
| PROMPT = "Summarize the key observable events in this 1-minute convenience store video clip. Focus strictly on the physical actions and interactions of the people. Describe only what you can see; do not interpret intentions, relationships, or work efficiency. Avoid all repetitive descriptions of the store's layout or shelves." | |
| files = os.listdir(VIDEO_FILE_DIR) | |
| files.sort() | |
| total_output = {} | |
| cur_time = time.strftime("%Y%m%d_%H%M%S", time.localtime()) | |
| output_file_path = os.path.join(output_dir, cur_time, f"{VIDEO_FILE_DIR.split('/')[-1]}.json") | |
| os.makedirs(os.path.join(output_dir, cur_time), exist_ok=True) | |
| for file in tqdm(files): | |
| video_file_path = os.path.join(VIDEO_FILE_DIR, file) | |
| start_time = time.time() | |
| command = ( | |
| f"curl -v -X POST '{API_URL}' " | |
| f"-F \"prompt={PROMPT}\" " | |
| f"-F 'video_file={video_file_path}' " | |
| f"-F 'sampling_method=uniform' " | |
| f"-F 'sampling_rate=30' " | |
| ) | |
| print("将要执行以下 cURL 命令:") | |
| print("---------------------------------") | |
| print(command) | |
| print("---------------------------------") | |
| print("\n正在执行...\n") | |
| return_result = subprocess.check_output(command, shell=True) | |
| response = json.loads(return_result) | |
| total_output[file] = response | |
| end_time = time.time() | |
| total_output[file]["request_time"] = end_time - start_time | |
| with open(output_file_path, "w") as f: | |
| json.dump(total_output, f, indent=4) | |
| print("\n\n✅ 测试脚本执行完毕。") | |