File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,24 @@ backbone = keras_nlp.models.Backbone.from_preset("hf://${model.id}")
261261` ,
262262] ;
263263
264+ export const llama_cpp_python = ( model : ModelData ) : string [ ] => [
265+ `from llama_cpp import Llama
266+
267+ llm = Llama.from_pretrained(
268+ repo_id="${ model . id } ",
269+ filename="{{GGUF_FILE}}",
270+ )
271+
272+ llm.create_chat_completion(
273+ messages = [
274+ {
275+ "role": "user",
276+ "content": "What is the capital of France?"
277+ }
278+ ]
279+ )` ,
280+ ] ;
281+
264282export const tf_keras = ( model : ModelData ) : string [ ] => [
265283 `# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy)
266284# See https://github.com/keras-team/tf-keras for more details.
Original file line number Diff line number Diff line change @@ -314,6 +314,12 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
314314 filter : false ,
315315 countDownloads : `path:"liveportrait/landmark.onnx"` ,
316316 } ,
317+ "llama-cpp-python" : {
318+ prettyLabel : "llama-cpp-python" ,
319+ repoName : "llama-cpp-python" ,
320+ repoUrl : "https://github.com/abetlen/llama-cpp-python" ,
321+ snippets : snippets . llama_cpp_python ,
322+ } ,
317323 mindspore : {
318324 prettyLabel : "MindSpore" ,
319325 repoName : "mindspore" ,
You can’t perform that action at this time.
0 commit comments