Class: RubyLLM::Tokenizer::Configuration
- Inherits:
-
Object
- Object
- RubyLLM::Tokenizer::Configuration
- Defined in:
- lib/ruby_llm/tokenizer/configuration.rb
Instance Attribute Summary collapse
-
#approximate_warn ⇒ Object
Returns the value of attribute approximate_warn.
-
#cache_dir ⇒ Object
Returns the value of attribute cache_dir.
-
#hf_token ⇒ Object
Returns the value of attribute hf_token.
-
#offline ⇒ Object
Returns the value of attribute offline.
Instance Method Summary collapse
- #default_cache_dir ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 |
# File 'lib/ruby_llm/tokenizer/configuration.rb', line 10 def initialize @cache_dir = default_cache_dir @offline = false @hf_token = ENV["HF_TOKEN"] || ENV.fetch("HUGGING_FACE_HUB_TOKEN", nil) @approximate_warn = true end |
Instance Attribute Details
#approximate_warn ⇒ Object
Returns the value of attribute approximate_warn.
8 9 10 |
# File 'lib/ruby_llm/tokenizer/configuration.rb', line 8 def approximate_warn @approximate_warn end |
#cache_dir ⇒ Object
Returns the value of attribute cache_dir.
8 9 10 |
# File 'lib/ruby_llm/tokenizer/configuration.rb', line 8 def cache_dir @cache_dir end |
#hf_token ⇒ Object
Returns the value of attribute hf_token.
8 9 10 |
# File 'lib/ruby_llm/tokenizer/configuration.rb', line 8 def hf_token @hf_token end |
#offline ⇒ Object
Returns the value of attribute offline.
8 9 10 |
# File 'lib/ruby_llm/tokenizer/configuration.rb', line 8 def offline @offline end |
Instance Method Details
#default_cache_dir ⇒ Object
17 18 19 20 |
# File 'lib/ruby_llm/tokenizer/configuration.rb', line 17 def default_cache_dir base = ENV["XDG_CACHE_HOME"] || File.join(Dir.home, ".cache") Pathname.new(File.join(base, "ruby_llm", "tokenizer")) end |