mlx-examples/llms/export/mlxlm.h

16 lines
404 B
C
Raw Normal View History

2025-01-09 08:17:45 +08:00
// Copyright © 2024 Apple Inc.
#include <mlx/mlx.h>
#include "tokenizer.h"
namespace mx = mlx::core;
2025-01-10 07:21:17 +08:00
std::function<mx::Args(mx::Args)> load_model(const std::string &path);
2025-01-09 08:17:45 +08:00
2025-01-10 07:21:17 +08:00
BPETokenizer load_tokenizer(const std::string &path);
2025-01-09 08:17:45 +08:00
2025-01-10 07:21:17 +08:00
void generate(const std::function<mx::Args(mx::Args)> &model,
const BPETokenizer &tokenizer, const std::string &prompt,
int max_tokens = 256);