llama.cpp/examples/high_level_api/high_level_api_embedding.py

12 lines
291 B
Python
Raw Normal View History

import argparse
from llama_cpp import Llama
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--model", type=str, default="../models/7B/ggml-model.bin")
args = parser.parse_args()
llm = Llama(model_path=args.model, embedding=True)
2023-04-01 17:02:51 +00:00
print(llm.create_embedding("Hello world!"))