red-candle 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52c635f005d25a305f99781763a4a3cc03f85fc5b74f0e576e51973ef8306fac
4
- data.tar.gz: 1a0ac260a3803f1920ba2d9f71ec361013ae1eb99cf2caed62c0e9aecc583e96
3
+ metadata.gz: 7405c9911d6088106dd7a19e96312f12b86e9a80087c3d7745cd3911e263890a
4
+ data.tar.gz: a88b75152708e72e019aba9acfeabd899f1ae1d1c567562ded6d2c6aa8eae8d0
5
5
  SHA512:
6
- metadata.gz: d301e6ed0fe8ac144c0735288c687f5dd74e7967dbe5d357e550ca5d467f6a33017b2bd9e7f46081711b6bf13555caa3e044183cd74cfaa89151e15c8cdb04a4
7
- data.tar.gz: d296c35002b6d0ed919176375e5cc5d93c70fae0c0ae9a02d5cf86b8a4a49a67898c7fbc96e16350bba6792b18792126c976de156fb854b9b4f3260fa052cd79
6
+ metadata.gz: ce1cc52dc1223968f3398ab0972283a6309a80d306c14193f23336cd36ed55c8fa5eaaaf05d756f76c88e442abe19b0d82d2742a49199930ef6effcffd6d4482
7
+ data.tar.gz: 8c30f3c0c096f8186b219a9a5d0fe92928621126f545eaabae26ddedc843515b7da8c45890a1f24a7d519c0c68fcd55b0553ea73f977644258ff30c5e5ccd2f1
data/README.md CHANGED
@@ -60,6 +60,25 @@ end
60
60
  - **NER**: Named Entity Recognition directly from Ruby
61
61
  - **LLM**: Chat with Large Language Models (e.g., Llama, Mistral, Gemma)
62
62
 
63
+ ## Model Storage
64
+
65
+ Models are automatically downloaded and cached when you first use them. They are stored in:
66
+ - **Location**: `~/.cache/huggingface/hub/`
67
+ - **Size**: Models range from ~100MB (embeddings) to several GB (LLMs)
68
+ - **Reuse**: Models are downloaded once and reused across sessions
69
+
70
+ To check your cache or manage storage:
71
+ ```bash
72
+ # View cache contents
73
+ ls -la ~/.cache/huggingface/hub/
74
+
75
+ # Check total cache size
76
+ du -sh ~/.cache/huggingface/
77
+
78
+ # Clear cache if needed (removes all downloaded models)
79
+ rm -rf ~/.cache/huggingface/hub/
80
+ ```
81
+
63
82
  ----
64
83
 
65
84
  ## Usage
@@ -194,7 +213,7 @@ llm = Candle::LLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0", device:
194
213
  # Metal
195
214
  device = Candle::Device.metal
196
215
 
197
- # CUDA support (for NVIDIA GPUs COMING SOON)
216
+ # CUDA support (for NVIDIA GPUs)
198
217
  device = Candle::Device.cuda # Linux/Windows with NVIDIA GPU
199
218
  ```
200
219
 
@@ -840,7 +859,7 @@ Pull requests are welcome.
840
859
  2. `bundle exec rake build`
841
860
  3. `git tag VERSION_NUMBER`
842
861
  4. `git push --follow-tags`
843
- 5. `gem push pkg/red-candle-1.0.0.gem`
862
+ 5. `gem push pkg/red-candle-VERSION_NUMBER.gem`
844
863
 
845
864
  ## See Also
846
865
 
data/ext/candle/build.rs CHANGED
@@ -16,6 +16,7 @@ fn main() {
16
16
  println!("cargo:rerun-if-env-changed=CUDA_PATH");
17
17
  println!("cargo:rerun-if-env-changed=CANDLE_FEATURES");
18
18
  println!("cargo:rerun-if-env-changed=CANDLE_ENABLE_CUDA");
19
+ println!("cargo:rerun-if-env-changed=CANDLE_DISABLE_CUDA");
19
20
 
20
21
  // Check if we should force CPU only
21
22
  if env::var("CANDLE_FORCE_CPU").is_ok() {
@@ -26,13 +27,13 @@ fn main() {
26
27
 
27
28
  // Detect CUDA availability
28
29
  let cuda_available = detect_cuda();
29
- let cuda_enabled = env::var("CANDLE_ENABLE_CUDA").is_ok();
30
+ let cuda_disabled = env::var("CANDLE_DISABLE_CUDA").is_ok();
30
31
 
31
- if cuda_available && cuda_enabled {
32
+ if cuda_available && !cuda_disabled {
32
33
  println!("cargo:rustc-cfg=has_cuda");
33
- println!("cargo:warning=CUDA detected and enabled via CANDLE_ENABLE_CUDA");
34
- } else if cuda_available && !cuda_enabled {
35
- println!("cargo:warning=CUDA detected but not enabled. To enable CUDA support (coming soon), set CANDLE_ENABLE_CUDA=1");
34
+ println!("cargo:warning=CUDA detected, CUDA acceleration will be available");
35
+ } else if cuda_available && cuda_disabled {
36
+ println!("cargo:warning=CUDA detected but disabled via CANDLE_DISABLE_CUDA");
36
37
  }
37
38
 
38
39
  // Detect Metal availability (macOS only)
@@ -15,10 +15,10 @@ else
15
15
  (File.exist?('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA') ||
16
16
  File.exist?('C:\CUDA')))
17
17
 
18
- cuda_enabled = ENV['CANDLE_ENABLE_CUDA']
18
+ cuda_disabled = ENV['CANDLE_DISABLE_CUDA']
19
19
 
20
- if cuda_available && cuda_enabled
21
- puts "CUDA detected and enabled via CANDLE_ENABLE_CUDA"
20
+ if cuda_available && !cuda_disabled
21
+ puts "CUDA detected, enabling CUDA support"
22
22
  features << 'cuda'
23
23
 
24
24
  # Check if CUDNN should be enabled
@@ -26,10 +26,9 @@ else
26
26
  puts "CUDNN support enabled"
27
27
  features << 'cudnn'
28
28
  end
29
- elsif cuda_available && !cuda_enabled
29
+ elsif cuda_available && cuda_disabled
30
30
  puts "=" * 80
31
- puts "CUDA detected but not enabled."
32
- puts "To enable CUDA support (coming soon), set CANDLE_ENABLE_CUDA=1"
31
+ puts "CUDA detected but disabled via CANDLE_DISABLE_CUDA"
33
32
  puts "=" * 80
34
33
  end
35
34
 
@@ -15,8 +15,8 @@ module Candle
15
15
  if cuda_potentially_available
16
16
  warn "=" * 80
17
17
  warn "Red Candle: CUDA detected on system but not enabled in build."
18
- warn "To enable CUDA support (experimental), reinstall with:"
19
- warn " CANDLE_ENABLE_CUDA=1 gem install red-candle"
18
+ warn "This may be due to CANDLE_DISABLE_CUDA being set during installation."
19
+ warn "To enable CUDA support, reinstall without CANDLE_DISABLE_CUDA set."
20
20
  warn "=" * 80
21
21
  end
22
22
  # :nocov:
@@ -1,5 +1,5 @@
1
1
  # :nocov:
2
2
  module Candle
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  # :nocov:
data/lib/red-candle.rb ADDED
@@ -0,0 +1 @@
1
+ require 'candle'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-candle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Petersen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-07-19 00:00:00.000000000 Z
12
+ date: 2025-07-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb_sys
@@ -197,6 +197,7 @@ files:
197
197
  - lib/candle/tensor.rb
198
198
  - lib/candle/tokenizer.rb
199
199
  - lib/candle/version.rb
200
+ - lib/red-candle.rb
200
201
  homepage: https://github.com/assaydepot/red-candle
201
202
  licenses:
202
203
  - MIT