llama_cpp 0.17.10 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec7b41006345cfe57e355d207718ae460a5a2c519d67027daddb7d40ab346754
4
- data.tar.gz: efcfa7eef5374790cef788f719bede1ab3cd30e5dec79be0ba9844bfbcd433c2
3
+ metadata.gz: 0a9263eee75a3d91907c711565799fd25820d8d2b0f0ae9818a24a0798b49bf4
4
+ data.tar.gz: 9f05051e8972baea44c4bd33f63190d5da8a62156c419fc02ec6b96ea3545c31
5
5
  SHA512:
6
- metadata.gz: c39150e77652060fcfee2c73b1334ff53ed40caf58679efa727a0d0d54bffe036b8795be9751cef8517b5d4b2300fb77fa5753a9c94b803988ec429b999591c2
7
- data.tar.gz: 6054dee2f39ac2690de2836405ac793bf987538ef0780cffab2700544bc60ceaca8a4b109407c66dcf2dd9f38ffe6b98659d7ca4ddb5c9e93fa85d9884cea26e
6
+ metadata.gz: 2543f1022462d32694649f2226d097537672bd6921af4fe6948687e00ef007b2e0425110abc7a3240d5dceb25131a3641bc9614f0e1117f3a7a40dcc55b23190
7
+ data.tar.gz: 0c54ea7e7617e99f52b0f005e8f871d5f69423e92d350bc93562ba56b48ff85a88ee6c3f01e1e6a71a0782a1bcf212f4900c7b88229a63935349cbdabee95cfc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [[0.18.0](https://github.com/yoshoku/llama_cpp.rb/compare/v0.17.10...v0.18.0)] - 2025-02-02
2
+
3
+ **Breaking Changes**
4
+ All the native extensions code was rewritten in C. The high-level API has been removed and replaced with a simple bindings library.
5
+ The fast update speed of llama.cpp makes it difficult to keep up with the creation of this binding library.
6
+ [As previously noted](https://github.com/yoshoku/llama_cpp.rb/blob/main/CHANGELOG.md#060---2023-09-30),
7
+ the author has given up on continuing to develop this binding library. Thank you for your understanding.
8
+
1
9
  ## [[0.17.10](https://github.com/yoshoku/llama_cpp.rb/compare/v0.17.9...v0.17.10)] - 2024-09-07
2
10
 
3
11
  - Change supported llama.cpp version to b3676.
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023-2024 Atsushi Tatsuma
3
+ Copyright (c) 2023-2025 Atsushi Tatsuma
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -57,41 +57,20 @@ An example of Ruby code that generates sentences with the quantization model is
57
57
  ```ruby
58
58
  require 'llama_cpp'
59
59
 
60
- model_params = LLaMACpp::ModelParams.new
61
- model = LLaMACpp::Model.new(model_path: '/home/user/llama.cpp/models/open_llama_7b/ggml-model-q4_0.bin', params: model_params)
60
+ LlamaCpp.ggml_backend_load_all
62
61
 
63
- context_params = LLaMACpp::ContextParams.new
64
- context_params.seed = 42
65
- context = LLaMACpp::Context.new(model: model, params: context_params)
62
+ model_params = LlamaCpp::LlamaModelParams.new
63
+ model = LlamaCpp::llama_model_load_from_file('/home/user/llama.cpp/models/open_llama_7b/ggml-model-q4_0.bin', model_params)
66
64
 
67
- puts LLaMACpp.generate(context, 'Hello, World.')
68
- ```
69
-
70
- ## Examples
71
- There is a sample program in the [examples](https://github.com/yoshoku/llama_cpp.rb/tree/main/examples) directory that allow interactvie communication like ChatGPT.
72
-
73
- ```sh
74
- $ git clone https://github.com/yoshoku/llama_cpp.rb.git
75
- $ cd examples
76
- $ bundle install
77
- $ ruby chat.rb --model /home/user/llama.cpp/models/open_llama_7b/ggml-model-q4_0.bin --seed 2023
78
- ...
79
- User: Who is the originator of the Ruby programming language?
80
- Bob: The originator of the Ruby programming language is Mr. Yukihiro Matsumoto.
81
- User:
82
- ```
83
-
84
- ![llama_cpp_chat_example](https://github.com/yoshoku/llama_cpp.rb/assets/5562409/374ae3d8-63a6-498f-ae6e-5552b464bdda)
65
+ context_params = LlamaCpp::LlamaContextParams.new
66
+ context = LlamaCpp.llama_init_from_model(model, context_params)
85
67
 
86
- Japanse chat is also possible using the [Vicuna model on Hugging Face](https://huggingface.co/CRD716/ggml-vicuna-1.1-quantized).
68
+ puts LLaMACpp.generate(context, 'Hello, World.')
87
69
 
88
- ```sh
89
- $ wget https://huggingface.co/CRD716/ggml-vicuna-1.1-quantized/resolve/main/ggml-vicuna-7b-1.1-q4_0.bin
90
- $ ruby chat.rb --model ggml-vicuna-7b-1.1-q4_0.bin --file prompt_jp.txt
70
+ LlamaCpp.llama_free(context)
71
+ LlamaCpp.llama_model_free(model)
91
72
  ```
92
73
 
93
- ![llama_cpp rb-jpchat](https://github.com/yoshoku/llama_cpp.rb/assets/5562409/526ff18c-2bb2-4b06-8933-f72960024033)
94
-
95
74
  ## Contributing
96
75
 
97
76
  Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/llama_cpp.rb.
@@ -2,10 +2,7 @@
2
2
 
3
3
  require 'mkmf'
4
4
 
5
- abort('libstdc++ is not found.') unless have_library('stdc++')
6
5
  abort('libllama is not found.') unless have_library('llama')
7
6
  abort('llama.h is not found.') unless have_header('llama.h')
8
7
 
9
- $CXXFLAGS << ' -std=c++11'
10
-
11
8
  create_makefile('llama_cpp/llama_cpp')