-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundler inline is broken because of dependency loader #517
Comments
@ipepe Do you have any good ideas for a fix here? |
Not really. Maybe it would be possible to detect that |
Hi both I tried last version (main) of the gem and couldn't reproduce the bug. Not sure what exactly has helped. Maybe the ruby version, as I'm using never ruby version (3.3.4). My ruby inline script: require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
ruby '3.3.4'
gem 'langchainrb', path: './'
gem 'pdf-reader', '~> 1.4'
gem 'pg'
gem 'pgvector'
gem 'faraday'
gem 'sequel'
end
require 'langchain'
require 'forwardable'
llm = Langchain::LLM::Ollama.new(
url: 'http://host.docker.internal:11434',
default_options: {
completion_model_name: 'llama3.1',
embeddings_model_name: 'llama3.1'
}
)
p llm.summarize text: "A big cat by Banksy appeared, poised ready to pounce, on a bare wooden advertising hoarding on Edgware Road in Cricklewood, north-west London, on Saturday." And response in console: root@7baf912223c4:/usr/src/app# ruby inline.rb
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
I, [2024-08-10T14:01:08.441997 #794] INFO -- request: POST http://host.docker.internal:11434/api/generate
I, [2024-08-10T14:01:08.442041 #794] INFO -- request: User-Agent: "Faraday v2.10.1"
Content-Type: "application/json"
I, [2024-08-10T14:01:08.442050 #794] INFO -- request: {"prompt":"Write a concise summary of the following TEXT. Do not include the word summary, just provide the summary.\n\nTEXT: A big cat by Banksy appeared, poised ready to pounce, on a bare wooden advertising hoarding on Edgware Road in Cricklewood, north-west London, on Saturday.\n\nCONCISE SUMMARY:\n","model":"llama3.1","stream":false,"options":{"temperature":0.0}}
I, [2024-08-10T14:01:13.299834 #794] INFO -- response: Status 200
I, [2024-08-10T14:01:13.316055 #794] INFO -- response: content-type: "application/json; charset=utf-8"
date: "Sat, 10 Aug 2024 14:01:13 GMT"
content-length: "852"
I, [2024-08-10T14:01:13.324356 #794] INFO -- response:
#<Langchain::LLM::OllamaResponse:0x0000ffff65039ca0 @prompt_tokens=nil, @raw_response={"model"=>"llama3.1", "created_at"=>"2024-08-10T14:01:12.966881Z", "response"=>"A new Banksy artwork, featuring a large cat, was installed on an advertising hoarding in northwest London.", "done"=>true, "done_reason"=>"stop", "context"=>[128009, 128006, 882, 128007, 271, 8144, 264, 64694, 12399, 315, 279, 2768, 16139, 13, 3234, 539, 2997, 279, 3492, 12399, 11, 1120, 3493, 279, 12399, 382, 12998, 25, 362, 2466, 8415, 555, 38866, 88, 9922, 11, 54946, 5644, 311, 281, 9933, 11, 389, 264, 12743, 23162, 13172, 11640, 29510, 389, 3279, 70, 1698, 9728, 304, 4656, 26688, 6798, 11, 10411, 38702, 7295, 11, 389, 7884, 382, 5910, 34, 9311, 96885, 512, 128009, 128006, 78191, 128007, 271, 32, 502, 38866, 88, 29409, 11, 16850, 264, 3544, 8415, 11, 574, 10487, 389, 459, 13172, 11640, 29510, 304, 53342, 7295, 13], "total_duration"=>4515482541, "load_duration"=>46927708, "prompt_eval_count"=>77, "prompt_eval_duration"=>2062662000, "eval_count"=>23, "eval_duration"=>2395670000}, @model="llama3.1"> |
@Rukomoynikov Thank you for glancing this over! @ipepe I'm closing this ticket for now unless you "re-raise" this issue! Thanks! |
When I try to use langchain in inline bundler it breaks:
I managed to get it temporarily fixed with:
But the initial error message looks like this:
The text was updated successfully, but these errors were encountered: