Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
cfb1ddd6
Unverified
Commit
cfb1ddd6
authored
Nov 25, 2024
by
Simon Schampijer
Committed by
GitHub
Nov 24, 2024
Browse files
examples: update langchain-python-simple (#3591)
- better formatting of input prompt - use invoke instead of predict
parent
3987acd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/langchain-python-simple/main.py
examples/langchain-python-simple/main.py
+2
-2
No files found.
examples/langchain-python-simple/main.py
View file @
cfb1ddd6
from
langchain.llms
import
Ollama
from
langchain.llms
import
Ollama
input
=
input
(
"What is your question?"
)
input
=
input
(
"What is your question?
\n
>
"
)
llm
=
Ollama
(
model
=
"llama3.2"
)
llm
=
Ollama
(
model
=
"llama3.2"
)
res
=
llm
.
predict
(
input
)
res
=
llm
.
invoke
(
input
)
print
(
res
)
print
(
res
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment