Skip to content

Commit 6350b96

Browse files
update lchain ollama notebook
1 parent c2a85f1 commit 6350b96

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

llm/lchain_ollama.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def calculate_total_sales(df):
123123
"""
124124
completion_response = llm.invoke(text)
125125
print(completion_response)
126-
return OllamaLLM, llm, text
126+
return (OllamaLLM,)
127127

128128

129129
@app.cell(hide_code=True)
@@ -133,9 +133,9 @@ def _(mo):
133133

134134

135135
@app.cell
136-
def _(llm, text):
137-
for chunk in llm.stream(text):
138-
print(chunk, end="", flush=True)
136+
def _():
137+
# for chunk in llm.stream(text):
138+
# print(chunk, end="", flush=True)
139139
return
140140

141141

@@ -273,12 +273,7 @@ def _(mo):
273273

274274
@app.cell(hide_code=True)
275275
def _(mo):
276-
mo.md(
277-
r"""
278-
### Working with Embeddings
279-
280-
"""
281-
)
276+
mo.md(r"""### Working with Embeddings""")
282277
return
283278

284279

@@ -369,9 +364,9 @@ def _(PromptTemplate):
369364
Use the following context to answer the question. If the answer isn't in the context, say so.
370365
Context:
371366
{context}
372-
367+
373368
Question: {question}
374-
369+
375370
Answer:
376371
""")
377372
return (rag_prompt,)

public/llm/lchain_ollama.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)