mirror of
https://github.com/neuml/txtai.git
synced 2026-10-12 02:19:52 +00:00
Update notebook
This commit is contained in:
@@ -158,7 +158,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": null,
|
||||
"id": "c7ff2a35",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -173,7 +173,7 @@
|
||||
"source": [
|
||||
"import sqlite3\n",
|
||||
"\n",
|
||||
"from txtai import LLM, RAG\n",
|
||||
"from txtai import LLM\n",
|
||||
"\n",
|
||||
"def keyword(query):\n",
|
||||
" return llm(f\"\"\"\n",
|
||||
@@ -203,16 +203,6 @@
|
||||
"# Load the LLM\n",
|
||||
"llm = LLM(\"Qwen/Qwen3-4B-Instruct-2507\")\n",
|
||||
"\n",
|
||||
"template = \"\"\"\n",
|
||||
" Answer the following question using the provided context.\n",
|
||||
"\n",
|
||||
" Question:\n",
|
||||
" {question}\n",
|
||||
"\n",
|
||||
" Context:\n",
|
||||
" {context}\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
"# RAG with a SQL query\n",
|
||||
"rag = RAG(sqlsearch, llm, template=template, output=\"flatten\")\n",
|
||||
"print(rag(\"Tell me what happened in the 2025 World Series\", maxlength=2048))"
|
||||
|
||||
Reference in New Issue
Block a user