Skip to content
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

Proposed Modification for Dynamically Managing Models in Langchain::LLM::Ollama #441

Merged
merged 5 commits into from
Jan 17, 2024

Conversation

Jhonnyr97
Copy link
Contributor

@Jhonnyr97 Jhonnyr97 commented Jan 14, 2024

Refactor of Langchain::LLM::Ollama

This refactoring was inspired by the implementation of Langchain::LLM::OpenAI, particularly in terms of parameter usage.

Solved Problems

  • Exception Generated by llm.embed: Previously, invoking llm.embed(text: "hello world") caused a Faraday::ResourceNotFound type exception. This problem has now been identified and resolved.
  • Non-Existent Streaming Support: Previously, streaming was not actually supported. The current modification introduces support for streaming.
  • Parameter Management in the complete and embed Methods: The complete and embed methods did not offer a simple management of parameters. This pull request introduces the allowed parameters, in line with the specifications of the documentation.

num_thread: nil,
repeat_last_n: nil,
repeat_penalty: nil,
temperature: nil,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the embed endpoint really take the temperature parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems strange to me too but in the documentation it indicates that you can enter the parameters you find in the Modelfile
Screenshot 2024-01-17 alle 20 21 31

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... seems to be the case.

@andreibondarev andreibondarev self-requested a review January 17, 2024 20:01
Copy link
Collaborator

@andreibondarev andreibondarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jhonnyr97 Great job, thank you!

@andreibondarev andreibondarev merged commit 2a2ca44 into patterns-ai-core:main Jan 17, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants