Feature Extraction
Transformers
Safetensors
GGUF
Chinese
qwen
beisen
train
custom_code
conversational
Instructions to use maxosai/Beisen-AI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use maxosai/Beisen-AI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="maxosai/Beisen-AI", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("maxosai/Beisen-AI", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use maxosai/Beisen-AI 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 maxosai/Beisen-AI:F16 # Run inference directly in the terminal: llama cli -hf maxosai/Beisen-AI:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf maxosai/Beisen-AI:F16 # Run inference directly in the terminal: llama cli -hf maxosai/Beisen-AI:F16
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 maxosai/Beisen-AI:F16 # Run inference directly in the terminal: ./llama-cli -hf maxosai/Beisen-AI:F16
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 maxosai/Beisen-AI:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf maxosai/Beisen-AI:F16
Use Docker
docker model run hf.co/maxosai/Beisen-AI:F16
- LM Studio
- Jan
- Ollama
How to use maxosai/Beisen-AI with Ollama:
ollama run hf.co/maxosai/Beisen-AI:F16
- Unsloth Studio
How to use maxosai/Beisen-AI 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 maxosai/Beisen-AI 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 maxosai/Beisen-AI to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for maxosai/Beisen-AI to start chatting
- Docker Model Runner
How to use maxosai/Beisen-AI with Docker Model Runner:
docker model run hf.co/maxosai/Beisen-AI:F16
- Lemonade
How to use maxosai/Beisen-AI with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull maxosai/Beisen-AI:F16
Run and chat with the model
lemonade run user.Beisen-AI-F16
List all available models
lemonade list
- Atomic Chat
| from torch.utils import cpp_extension | |
| import pathlib | |
| import os | |
| import subprocess | |
| def _get_cuda_bare_metal_version(cuda_dir): | |
| raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], | |
| universal_newlines=True) | |
| output = raw_output.split() | |
| release_idx = output.index("release") + 1 | |
| release = output[release_idx].split(".") | |
| bare_metal_major = release[0] | |
| bare_metal_minor = release[1][0] | |
| return raw_output, bare_metal_major, bare_metal_minor | |
| def _create_build_dir(buildpath): | |
| try: | |
| os.mkdir(buildpath) | |
| except OSError: | |
| if not os.path.isdir(buildpath): | |
| print(f"Creation of the build directory {buildpath} failed") | |
| # Check if cuda 11 is installed for compute capability 8.0 | |
| cc_flag = [] | |
| _, bare_metal_major, bare_metal_minor = _get_cuda_bare_metal_version(cpp_extension.CUDA_HOME) | |
| if int(bare_metal_major) >= 11: | |
| cc_flag.append('-gencode') | |
| cc_flag.append('arch=compute_80,code=sm_80') | |
| if int(bare_metal_minor) >= 7: | |
| cc_flag.append('-gencode') | |
| cc_flag.append('arch=compute_90,code=sm_90') | |
| # Build path | |
| srcpath = pathlib.Path(__file__).parent.absolute() | |
| buildpath = srcpath / 'build' | |
| _create_build_dir(buildpath) | |
| def _cpp_extention_load_helper(name, sources, extra_cuda_flags): | |
| return cpp_extension.load( | |
| name=name, | |
| sources=sources, | |
| build_directory=buildpath, | |
| extra_cflags=['-O3', ], | |
| extra_cuda_cflags=['-O3', | |
| '-gencode', 'arch=compute_70,code=sm_70', | |
| '--use_fast_math'] + extra_cuda_flags + cc_flag, | |
| verbose=1 | |
| ) | |
| extra_flags = [] | |
| cache_autogptq_cuda_256_sources = ["./cache_autogptq_cuda_256.cpp", | |
| "./cache_autogptq_cuda_kernel_256.cu"] | |
| cache_autogptq_cuda_256 = _cpp_extention_load_helper("cache_autogptq_cuda_256", cache_autogptq_cuda_256_sources, extra_flags) | |