Feature Extraction
Transformers
Safetensors
GGUF
Chinese
qwen
beisen
train
custom_code
conversational
Instructions to use maxosai/BeisenAI-7B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use maxosai/BeisenAI-7B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="maxosai/BeisenAI-7B-Chat", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("maxosai/BeisenAI-7B-Chat", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use maxosai/BeisenAI-7B-Chat with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible embeddings server: llama serve -hf maxosai/BeisenAI-7B-Chat --embeddings
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible embeddings server: llama serve -hf maxosai/BeisenAI-7B-Chat --embeddings
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible embeddings server: ./llama-server -hf maxosai/BeisenAI-7B-Chat --embeddings
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 embeddings server: ./build/bin/llama-server -hf maxosai/BeisenAI-7B-Chat --embeddings
- Llama new
- LM Studio
- Jan
- Ollama
How to use maxosai/BeisenAI-7B-Chat with Ollama:
ollama run hf.co/maxosai/BeisenAI-7B-Chat
- Unsloth Desktop
- Docker Model Runner
How to use maxosai/BeisenAI-7B-Chat with Docker Model Runner:
docker model run hf.co/maxosai/BeisenAI-7B-Chat
- Lemonade
How to use maxosai/BeisenAI-7B-Chat with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull maxosai/BeisenAI-7B-Chat
Run and chat with the model
lemonade run user.BeisenAI-7B-Chat-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Download cpp_kernels.py from maxosai/BeisenAI-7B-Chat: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/maxosai/BeisenAI-7B-Chat/resolve/main/cpp_kernels.py
- Command line
-
hf download hf://maxosai/BeisenAI-7B-Chat/cpp_kernels.py
-
curl -L -o cpp_kernels.py https://huggingface.co/maxosai/BeisenAI-7B-Chat/resolve/main/cpp_kernels.py
1.92 kB
| 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) | |