curl -X POST "http://127.0.0.1:8000/v1/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "ds-r1-1.5b", "prompt": "Compute the Fourier transform of the constant function f(t) = 1. What should the correct answer be?", "max_tokens": 50, "temperature": 0.7 }'
# ====理论输出==== # answer is 2πδ(ω)
查看容器对显卡的识别
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
python3 - <<'PY' import torch print("PyTorch 版本:", torch.__version__) print("是否可见 HIP/GPU:", torch.cuda.is_available()) print("GPU 数量:", torch.cuda.device_count()) for i in range(torch.cuda.device_count()): print(f"设备 {i} 名称:", torch.cuda.get_device_name(i)) PY
/** * 会话、用户信息的包装类 */ dataclassWebSocketSenderSession<T>( val session: WebSocketSession, val user: T, /** 心跳超时标志 */ val lastHeartbeat: Long = System.currentTimeMillis() )
overridefunonUpstreamFirstMessage(session: WebSocketSession, message: WebSocketMessage<*>): ChatUser? { val message = message.toObjectNode() ?: returnnull val ak = message.get("ak")?.asText() ?: returnnull val name = message.get("name")?.asText() ?: returnnull if (ak != "123456") returnnull // 创建用户 val user = ChatUser( session.id, name) // 给该用户发送欢迎信息 session.sendMessage(TextMessage("Hi, $name. Please chat friendly!")) // 群发用户入群提示 publishAll(TextMessage("$name've joined the chat room.")) return user }
overridefunonSessionClosed(sender: WebSocketSenderSession<ChatUser>) { // 群发用户离开提示 publishAll(TextMessage("${sender.user.name} has left the chat room.")) }