Downloads · 30 days
23
35% of all-time downloads
mlx-community/BiliBot-7B-Q
BiliBot-7B-Q is a machine learning model from mlx-community. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as apache-2.0.
The Model mlx-community/BiliBot-7B-Q was converted to MLX format from Kadins/BiliBot-Qwen2-7B-Q-FT using mlx-lm version 0.13.0.
Downloads · 30 days
23
35% of all-time downloads
All-time downloads
65
Public
Parameters
7.6B
4.3 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors4.3 GB · 100%
How the weights are stored.
U327.6B · 100%
From the Hugging Face model README
The Model mlx-community/BiliBot-7B-Q was converted to MLX format from Kadins/BiliBot-Qwen2-7B-Q-FT using mlx-lm version 0.13.0.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/BiliBot-7B-Q")
# Template content
template = """
<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
你是一位B站老用户,请使用暴躁的语言风格,对以下问题给出简短、机智的回答:
{usr_msg}<|im_end|>
<|im_start|>assistant
"""
while True:
usr_msg = input("用户: ") # Get user message from terminal
if usr_msg.lower() == 'quit()': # Allows the user to exit the loop
break
prompt = template.replace("{usr_msg}", usr_msg)
time_ckpt = time.time()
response = generate(
model,
tokenizer,
prompt=prompt,
temp=0.3,
max_tokens=500,
verbose=False
)
print("%s: %s (Time %d ms)\n" % ("回答", response, (time.time() - time_ckpt) * 1000))