diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..72c89c30b08fc1d15b33f171c3bbb0e1d0a9f7a1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,37 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +Dataset/Drama/Broken_images.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Drama/Chandalika.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/non_fiction/Flim_making.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/non_fiction/Freedom_freedom.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/non_fiction/On_science_fiction.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/non_fiction/The_argumentative_indian.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/non_fiction/The_mark_on_the_wall.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/non_fiction/Why_the_novel_matters.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Poems/A_lecture_upon_the_shadow.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Poems/Blood.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Poems/Kubla_khan.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Poems/On_time.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Poems/The_divine_image.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Poems/The_wild_swans_at_coole.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Poems/Time_and_time_again.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Poems/Trees_emily_dickinson.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Stories/A_wedding_in_brownsville.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Stories/eveline.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Stories/I_sell_my_dreams.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Stories/One_centimetre.pdf filter=lfs diff=lfs merge=lfs -text +Dataset/Stories/Tomorrow.pdf filter=lfs diff=lfs merge=lfs -text +qdrant/a_wedding_in_brownsville/collection/A[[:space:]]Wedding[[:space:]]In[[:space:]]Brownsville/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/broken_images/collection/Broken[[:space:]]Images/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/chandalika/collection/Chandalika/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/eveline/collection/Eveline/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/film_making/collection/Flim[[:space:]]Making/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/freedom/collection/Freedom/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/i_sell_my_dreams/collection/I[[:space:]]Sell[[:space:]]My[[:space:]]Dreams/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/on_science_fiction/collection/On[[:space:]]Science[[:space:]]Fiction/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/one_centimeter/collection/One[[:space:]]Centimeter/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/the_argumentative_indian/collection/The[[:space:]]Argumentative[[:space:]]Indian/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/the_mark_on_the_wall/collection/The[[:space:]]Mark[[:space:]]On[[:space:]]The[[:space:]]Wall/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/tomorrow/collection/Tomorrow/storage.sqlite filter=lfs diff=lfs merge=lfs -text +qdrant/why_the_novel_matters/collection/Why[[:space:]]The[[:space:]]Novel[[:space:]]Matters/storage.sqlite filter=lfs diff=lfs merge=lfs -text diff --git a/Dataset/Drama/Broken_images.pdf b/Dataset/Drama/Broken_images.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d9415cef65996e53e6e0d9d42810f0377f1c82e3 --- /dev/null +++ b/Dataset/Drama/Broken_images.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb3d1033a5062055b07e220b953bef98c826325053a98071f752032cb05d2151 +size 1205904 diff --git a/Dataset/Drama/Chandalika.pdf b/Dataset/Drama/Chandalika.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5c0c305509a19e561873317630c060f7e56ebc75 --- /dev/null +++ b/Dataset/Drama/Chandalika.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b799d4ecd66890c86b731bfe4cc7509dcce80f2b6ca58ab38ca6d670a14c668 +size 1503804 diff --git a/Dataset/Poems/A_lecture_upon_the_shadow.pdf b/Dataset/Poems/A_lecture_upon_the_shadow.pdf new file mode 100644 index 0000000000000000000000000000000000000000..56f9bb02b5ec40065fb7dccec5990ed6bebc8b5d --- /dev/null +++ b/Dataset/Poems/A_lecture_upon_the_shadow.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d3dad7ab79d04266074f1b81dff5b2d92ebb62e68bfb25f739cbe5bb6e94565 +size 427016 diff --git a/Dataset/Poems/Blood.pdf b/Dataset/Poems/Blood.pdf new file mode 100644 index 0000000000000000000000000000000000000000..206d06581cbc500323941f8d759d656b25072b86 --- /dev/null +++ b/Dataset/Poems/Blood.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee043a03370a5363fc8c48e259efd80dcc93374dcb55ed4cd1f5765e26503344 +size 445656 diff --git a/Dataset/Poems/Kubla_khan.pdf b/Dataset/Poems/Kubla_khan.pdf new file mode 100644 index 0000000000000000000000000000000000000000..439f1b5b7d84f98e4e35abf29c2d9295c3d8c169 --- /dev/null +++ b/Dataset/Poems/Kubla_khan.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25fad91d337387e3a918877bb1e6984b2d54c6b85f35c726b3717fb0a3238caa +size 395237 diff --git a/Dataset/Poems/On_time.pdf b/Dataset/Poems/On_time.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fed23a9626f4b6ca44c203e43090e3f9a9e20bfa --- /dev/null +++ b/Dataset/Poems/On_time.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d489a5656a33fba7a730d36d38f119ca68982a830bc7aa7fa2258cdcf59a2ed6 +size 326945 diff --git a/Dataset/Poems/The_divine_image.pdf b/Dataset/Poems/The_divine_image.pdf new file mode 100644 index 0000000000000000000000000000000000000000..50115ee9ae1f2f6dbff183e6aff42731bb20db34 --- /dev/null +++ b/Dataset/Poems/The_divine_image.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67b9b33ef53a427b0738d4e14da9ec2a91ad78c4c13862d6a55d7d1ba4166766 +size 2087736 diff --git a/Dataset/Poems/The_wild_swans_at_coole.pdf b/Dataset/Poems/The_wild_swans_at_coole.pdf new file mode 100644 index 0000000000000000000000000000000000000000..570fc7b6907184a06470ce79199b83cd79dd2d97 --- /dev/null +++ b/Dataset/Poems/The_wild_swans_at_coole.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1348796ce97323c2ab35a30e9c5d6e76659e8b564adfcc6903b44884e39c6d18 +size 244804 diff --git a/Dataset/Poems/Time_and_time_again.pdf b/Dataset/Poems/Time_and_time_again.pdf new file mode 100644 index 0000000000000000000000000000000000000000..084b8fabf9de1195943208bd2fd1685739beedf0 --- /dev/null +++ b/Dataset/Poems/Time_and_time_again.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:093d7857e04e73576ae5bc806ea4610a67c0a863b01284408d0b610acfb2ce43 +size 286347 diff --git a/Dataset/Poems/Trees_emily_dickinson.pdf b/Dataset/Poems/Trees_emily_dickinson.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2f7aa3ccfe149334b9b88a40728f3fe282ab690b --- /dev/null +++ b/Dataset/Poems/Trees_emily_dickinson.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:feda4a8cf83af6ab8ae30dfc37d9e287cee8b7bd7846098dbf07b3e5d2e73eef +size 282261 diff --git a/Dataset/Stories/A_wedding_in_brownsville.pdf b/Dataset/Stories/A_wedding_in_brownsville.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1b9c44e2d831266417802ecb44affa69e36efe80 --- /dev/null +++ b/Dataset/Stories/A_wedding_in_brownsville.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d823be10f9ec9371998980df5f9c95ba5f6c5df623bfdf709d2d1bb8fa05f320 +size 1320450 diff --git a/Dataset/Stories/I_sell_my_dreams.pdf b/Dataset/Stories/I_sell_my_dreams.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6b99615fcb52a382374391d4f4836d633f4967b5 --- /dev/null +++ b/Dataset/Stories/I_sell_my_dreams.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1b5dbf330b6c2f0521e29527490f4703c6a9828202f6caac66ed3cef51f3c58 +size 866980 diff --git a/Dataset/Stories/One_centimetre.pdf b/Dataset/Stories/One_centimetre.pdf new file mode 100644 index 0000000000000000000000000000000000000000..57b85b38a801f309827ad35ff7e12187fd64bc66 --- /dev/null +++ b/Dataset/Stories/One_centimetre.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cf42598f64075f8a798884163521e2d5a2d261f7c42a5a59bf3ccffe67363a3 +size 1514845 diff --git a/Dataset/Stories/Tomorrow.pdf b/Dataset/Stories/Tomorrow.pdf new file mode 100644 index 0000000000000000000000000000000000000000..04dca8716e19069f59e1f68352cbdbd9e8b49e7e --- /dev/null +++ b/Dataset/Stories/Tomorrow.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8402b929756b19fd4b00711e08d402c8d7c06510d9b96f398d52a762494413a +size 2223787 diff --git a/Dataset/Stories/eveline.pdf b/Dataset/Stories/eveline.pdf new file mode 100644 index 0000000000000000000000000000000000000000..83874d13a14af075eddbe022604f5915ba4a65a0 --- /dev/null +++ b/Dataset/Stories/eveline.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de6561016ab5f2ce4539f6fb482e5e1b4fbb49071e839e81d79aa33304566420 +size 811025 diff --git a/Dataset/non_fiction/Flim_making.pdf b/Dataset/non_fiction/Flim_making.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1f6a45984758b6aa2de303961292e40d472770fa --- /dev/null +++ b/Dataset/non_fiction/Flim_making.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c831a45de18aac2a1c91e5927771afe88149dcee0f52a122acee62d60c12237c +size 1310774 diff --git a/Dataset/non_fiction/Freedom_freedom.pdf b/Dataset/non_fiction/Freedom_freedom.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2575cdffcc8bcfb8e4f0ce621e3d1497e4ec1ba1 --- /dev/null +++ b/Dataset/non_fiction/Freedom_freedom.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab53c4540e908cc3b5ba5873eeed3e583dab169f45c0ed3599be132c85a36927 +size 1303640 diff --git a/Dataset/non_fiction/On_science_fiction.pdf b/Dataset/non_fiction/On_science_fiction.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2b4128f10da9b93f4649a8b1dd83ebdded10d17e --- /dev/null +++ b/Dataset/non_fiction/On_science_fiction.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e41d663560cba7602e4a474340f5749b1946f6a059249ac1ae7e741aa4381ca2 +size 925262 diff --git a/Dataset/non_fiction/The_argumentative_indian.pdf b/Dataset/non_fiction/The_argumentative_indian.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f5426ceff0bf100aea9a73fe6c144d8bb675059f --- /dev/null +++ b/Dataset/non_fiction/The_argumentative_indian.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7c23fafb8b3a9bc0ebcc917b0a1fc391eee2a1d23483a449b40c15270bb1c21 +size 1114494 diff --git a/Dataset/non_fiction/The_mark_on_the_wall.pdf b/Dataset/non_fiction/The_mark_on_the_wall.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d19795050a628809491af3608f78f651ddba0389 --- /dev/null +++ b/Dataset/non_fiction/The_mark_on_the_wall.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4563eec7df95e63ac35b5df0532000f323df9b2b41d526e07464e0ed740cf5ad +size 954787 diff --git a/Dataset/non_fiction/Why_the_novel_matters.pdf b/Dataset/non_fiction/Why_the_novel_matters.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1519e8c9381c25d541976f2cb054afbbfae444e8 --- /dev/null +++ b/Dataset/non_fiction/Why_the_novel_matters.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa82bf32a32b8a6c92a496c7d240eff83e1262c32475899b53ae28c9abf323bb +size 864079 diff --git a/README.md b/README.md index e96819b8f2bd242daaeedbce9e57540008086b19..3a82c9661ce903a2c0f95b2792a507780e3cf068 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ --- -title: RAG Doc Chatbot -emoji: ๐Ÿ“š +title: KaleidoscopeChat +emoji: ๐Ÿ’ฌ colorFrom: yellow colorTo: purple sdk: gradio -sdk_version: 5.44.1 +sdk_version: 5.0.1 app_file: app.py pinned: false +license: mit +short_description: 'KaleidoscopChat answers queries: NCERT 12th Textbook.' --- -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index). \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000000000000000000000000000000000000..14b056b30adc955ca14ea20aeaf42efa37df1ad9 --- /dev/null +++ b/app.py @@ -0,0 +1,181 @@ +import os +import gradio as gr +#from langchain_openai import ChatOpenAI +from langchain_groq import ChatGroq +from langchain_core.runnables import Runnable +from chat_engine import conversation_prompt +from chat_engine import chapter_index +from chat_engine import tree_index_list +from chat_engine import select_index +from langchain_core.messages import SystemMessage, HumanMessage, AIMessage +from pathlib import Path +#from chat_engine import prompt_query + +groq_llm = ChatGroq( + model_name="llama-3.3-70b-versatile", + temperature=0.2, + api_key=os.getenv('GROQ_API_KEY') +) + +response_chain: Runnable = conversation_prompt | groq_llm + +#groq_user_engg=ChatGroq( + # model_name="llama3-70b-8192", + # temperature=0, + # api_key=os.getenv("GROQ_API") + #) + +#query_chain: Runnable = prompt_query | groq_user_engg + +def gradio_chat(user_query, chat_history, index, tree_index_list=tree_index_list, chapter_index=chapter_index,response_chain=response_chain): + + if chat_history is None: + chat_history=[] + + if user_query=="": + chat_history.append(HumanMessage(user_query)) + chat_history.append(AIMessage("Kindly ask a question from the selected chapter.")) + return "Kindly ask a question from the selected chapter", chat_history + + vector_index=select_index(index) + retriever1=vector_index.as_retriever(similarity_top_k=2) + retrieved_nodes1=retriever1.retrieve(user_query) + + tree_index=tree_index_list[chapter_index[retrieved_nodes1[0].metadata["chapter"]]] + if retrieved_nodes1[0].metadata["section"]=="poem": + retriever = tree_index.as_retriever(similarity_top_k=4, retriever_mode="all_leaf") + retrieved_nodes3=retriever.retrieve("summarize the poem") + #answer = response_synthesizer.synthesize(query=user_query, nodes=retrieved_nodes3) + pext="" + for content in retrieved_nodes3: + pext=pext+' '+content.text.strip() + context='Author: '+retrieved_nodes1[0].metadata['author']+'\nSection: '+retrieved_nodes1[0].metadata['section']+'\nChapter: '+retrieved_nodes1[0].metadata['chapter']+'\nContext: '+pext + + else: + contextt=[] + for text in retrieved_nodes1: + contextt.append((text.metadata['page'], text.text)) + contextt.sort(key=lambda x:x[0]) + context1=[x[1] for x in contextt] + + retriever = tree_index.as_retriever(similarity_top_k=1,retriever_mode="root", + search_kwargs={"num_children":3}) + + retrieved_nodes2=retriever.retrieve("summarize this chapter") + + for text in retrieved_nodes2: + context1.append(text.text.strip()) + context="\n".join(context1) + context='Author: '+retrieved_nodes1[0].metadata['author']+'\nSection: '+retrieved_nodes1[0].metadata['section']+'\nChapter: '+retrieved_nodes1[0].metadata['chapter']+'\nContext: '+context + + chat_history.append(HumanMessage(user_query)) + response=response_chain.invoke({"chat_history":chat_history[-12:], "user_query":user_query, "document_context":context}) + chat_history.append(AIMessage(response.content)) + + return response.content, chat_history + +#def prompt_engg(message, chain_history, index, previous_index="Broken Images"): + + #if previous_index == index: + #index_change=0 + #else: + #index_change=1 + #question=query_chain.invoke({"user_query":message, "chat_history":chain_history, "index":index, "index_change":index_change}) + + #return question.content + +def respond(message, chain_history, ui_history, index): + + ui_history.append({"role": "user", "content": message}) + #message=prompt_engg(message, chain_history, index) + response_text, updated_history = gradio_chat(message, chain_history, index=index) + + if ui_history is None: + ui_history = [] + + ui_history.append({"role": "assistant", "content": response_text}) + #print(ui_history) + return "", updated_history, ui_history + +def download_file(index): + filepath=chapter_dir[index] + return filepath + +custom_css = """ +#chatbot_interface { + background: #f0f0f0; + padding: 20px; + border-radius: 10px; +} + +/* Center the markdown text */ +#welcome_markdown { + text-align: center; + margin: auto; +} +""" + +with gr.Blocks(css=custom_css,fill_width=True) as demo: + gr.Markdown(""" + # Iโ€™m Shalini โ˜บ๏ธ # + Your Creative Muse โ€” Where Literature Dances, Art Breathes, and Philosophy Whispers ๐ŸŽจ๐Ÿ“–๐Ÿชž + + Welcome to *Kaleidoscope* โ€” + Where words donโ€™t just sit still โ€” they swirl, they shimmer, they *sing*. + Have a question from the 12th NCERT English textbook *Kaleidoscope*? + Ask โ€” and Iโ€™ll reply with words that wander, wonder, and land like truth. ๐Ÿ“š๐ŸŒฟ + --- + Letโ€™s begin this soulful journey together: + 1. Pick your chapter from the dropdown below. + 2. Step into the story with your question. + 3. Iโ€™ll craft a reply โ€” rhythmic, radiant, and rich with meaning. ๐Ÿ–ผ๏ธ๐Ÿ’ซ + """,elem_id="welcome_markdown") + + chapter_dir={"Broken Images":"Dataset/Drama/Broken_images.pdf", + "Blood":"Dataset/Poems/Blood.pdf", + "Flim Making":"Dataset/non_fiction/Flim_making.pdf", + "Kubla Khan":"Dataset/Poems/Kubla_khan.pdf", + "One Centimeter":"Dataset/Stories/One_centimetre.pdf", + "I Sell My Dreams":"Dataset/Stories/I_sell_my_dreams.pdf", + "Poems By Blake":"Dataset/Poems/The_divine_image.pdf", + "Time and Time Again":"Dataset/Poems/Time_and_time_again.pdf", + "On Time":"Dataset/Poems/On_time.pdf", + "Trees":"Dataset/Poems/Trees_emily_dickinson.pdf", + "On Science Fiction":"Dataset/non_fiction/On_science_fiction.pdf", + "The Argumentative Indian":"Dataset/non_fiction/The_argumentative_indian.pdf", + "Why The Novel Matters":"Dataset/non_fiction/Why_the_novel_matters.pdf", + "Tomorrow":"Dataset/Stories/Tomorrow.pdf", + "A Lecture Upon The Shadow":"Dataset/Poems/A_lecture_upon_the_shadow.pdf", + "Freedom":"Dataset/non_fiction/Freedom_freedom.pdf", + "A Wedding in Brownsville":"Dataset/Stories/A_wedding_in_brownsville.pdf", + "Eveline":"Dataset/Stories/eveline.pdf", + "Chandalika":"Dataset/Drama/Chandalika.pdf", + "The Wild Swans At Coole":"Dataset/Poems/The_wild_swans_at_coole.pdf", + "The Mark On The Wall":"Dataset/non_fiction/The_mark_on_the_wall.pdf"} + + chatbot = gr.Chatbot(label="Chat Interface", elem_id="chatbot_interface", type="messages") + + index=gr.State() + with gr.Row(): + index=gr.Dropdown( + choices=list(chapter_dir.keys()), + label="Chapter", + value="Broken Images", + info="Select the chapter on which you would like to ask questions." + ) + msg = gr.Textbox(label="Enter your query:", placeholder="Type your question here...", lines=2) + + d = gr.DownloadButton("Download Selected Chapter", visible=True) + index.change(fn=download_file, inputs=index, outputs=d) + #d.click(download_file, index, [d]) + + chain_history = gr.State([]) # For LangChain message objects + ui_history = gr.State([]) # For display, a list of dictionaries + + gr.Button("Glide In๐ŸŽจ").click(respond, [msg, chain_history, ui_history, index], [msg, chain_history, chatbot]) + + #clear = gr.ClearButton([msg, chatbot], size="sm") + msg.submit(fn=respond, inputs=[msg, chain_history, ui_history, index], outputs=[msg, chain_history, chatbot]) + +demo.launch(allowed_paths=["Dataset/Stories","Dataset/Drama", + "Dataset/Poems","Dataset/non_fiction"]) \ No newline at end of file diff --git a/chapter_index.pkl b/chapter_index.pkl new file mode 100644 index 0000000000000000000000000000000000000000..0386b5a890f431094b6d15fe806f3de1b3f2e04d --- /dev/null +++ b/chapter_index.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af263e6420b881ef922552239f3c0409c448b712c71ffbb75a35780255773ff9 +size 491 diff --git a/chat_engine.py b/chat_engine.py new file mode 100644 index 0000000000000000000000000000000000000000..1ec573fd829e1ae5b1b666c5a146cc1dc11b5583 --- /dev/null +++ b/chat_engine.py @@ -0,0 +1,45 @@ +import pickle +from langchain_core.prompts import ChatPromptTemplate +from langchain_core.runnables import Runnable +from langchain_openai import ChatOpenAI +from timeit import default_timer as timer +from llama_index.embeddings.huggingface import HuggingFaceEmbedding +from qdrant_client import QdrantClient +from llama_index.vector_stores.qdrant import QdrantVectorStore +from llama_index.core import StorageContext, VectorStoreIndex + +with open("custom_prompt.pkl", "rb") as file: + custom_template=pickle.load(file) + +with open("tree_index_list.pkl","rb") as f: + tree_index_list=pickle.load(f) + +with open("chapter_index.pkl","rb") as f: + chapter_index=pickle.load(f) + +with open("index_dict.pkl", "rb") as file: + index_dict=pickle.load(file) + +conversation_prompt=ChatPromptTemplate.from_template(template=custom_template) + +#with open("prompt_engg.pkl", "rb") as file: +# prompt_engg=pickle.load(file) + +#prompt_query=ChatPromptTemplate.from_template(template=prompt_engg) + +embedding_function = HuggingFaceEmbedding(model_name="sentence-transformers/all-roberta-large-v1") + +def select_index(index, index_dict=index_dict, embedding_function=embedding_function): + for key in index_dict: + if index==key: + + qdrant_local_path = index_dict[key] + qdrant_client = QdrantClient(path=qdrant_local_path) + collection_name = key + vector_size = 1024 + qdrant_vector_store = QdrantVectorStore(client=qdrant_client, collection_name=collection_name) + storage_context = StorageContext.from_defaults(vector_store=qdrant_vector_store) + vector_index = VectorStoreIndex.from_vector_store(vector_store=qdrant_vector_store, embed_model=embedding_function) + + return vector_index + diff --git a/custom_prompt.pkl b/custom_prompt.pkl new file mode 100644 index 0000000000000000000000000000000000000000..13eb0dcf779249cebf8dc8b4bced4153f789f512 --- /dev/null +++ b/custom_prompt.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4e5c69cc2b4f1a0f08a60400f1938e2065f588852a3413b51be84beef7f2c09 +size 3547 diff --git a/index_dict.pkl b/index_dict.pkl new file mode 100644 index 0000000000000000000000000000000000000000..e079cf8d075d7798117896c20f2a37fa2c1c4181 --- /dev/null +++ b/index_dict.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f25c1f2ade45f3d6505ce7d14de2a53a78fa15ea2391403914acc74083a76ee8 +size 891 diff --git a/prompt_engg.pkl b/prompt_engg.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ffbbdd08ecdc1256315770e8629cd88182c5d309 --- /dev/null +++ b/prompt_engg.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86f74a37f3395ab2dcb338817229a514fb088a73ef19f2a5375c62fe26b3eef0 +size 3387 diff --git a/qdrant/a_lecture_upon_the_shadow/collection/A Lecture Upon The Shadow/storage.sqlite b/qdrant/a_lecture_upon_the_shadow/collection/A Lecture Upon The Shadow/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..cd1daab9f3db772dc7f7ad37677e510d3cf83e14 Binary files /dev/null and b/qdrant/a_lecture_upon_the_shadow/collection/A Lecture Upon The Shadow/storage.sqlite differ diff --git a/qdrant/a_lecture_upon_the_shadow/meta.json b/qdrant/a_lecture_upon_the_shadow/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..533814a718a53ea3b660b5dd741a78e442491fd9 --- /dev/null +++ b/qdrant/a_lecture_upon_the_shadow/meta.json @@ -0,0 +1 @@ +{"collections": {"A Lecture Upon The Shadow": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/a_wedding_in_brownsville/collection/A Wedding In Brownsville/storage.sqlite b/qdrant/a_wedding_in_brownsville/collection/A Wedding In Brownsville/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a2c5cf5b69f33ff2667fac8f1530b11d6bcaf56c --- /dev/null +++ b/qdrant/a_wedding_in_brownsville/collection/A Wedding In Brownsville/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8679d7531ef82317bdd021eca23e36c786f7b37449d87fd7284bb87fac3cc3b +size 249856 diff --git a/qdrant/a_wedding_in_brownsville/meta.json b/qdrant/a_wedding_in_brownsville/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..1c91dfabec7750a881f5a88a389ab4ccee1aaa97 --- /dev/null +++ b/qdrant/a_wedding_in_brownsville/meta.json @@ -0,0 +1 @@ +{"collections": {"A Wedding In Brownsville": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/blood/collection/Blood/storage.sqlite b/qdrant/blood/collection/Blood/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..556103a7a79564e41a7758b1b5a6a4eed79e0717 Binary files /dev/null and b/qdrant/blood/collection/Blood/storage.sqlite differ diff --git a/qdrant/blood/meta.json b/qdrant/blood/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..2662db1983c335b4be7d3fe61e3bc8f033d217b2 --- /dev/null +++ b/qdrant/blood/meta.json @@ -0,0 +1 @@ +{"collections": {"Blood": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/broken_images/collection/Broken Images/storage.sqlite b/qdrant/broken_images/collection/Broken Images/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..050b6645633dda0b57bc5e0476b4cdb1745ed25b --- /dev/null +++ b/qdrant/broken_images/collection/Broken Images/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b05cde8cb5b216ba57c4d90bc9fce675267a067589937e5b578cd71f2277e04 +size 192512 diff --git a/qdrant/broken_images/meta.json b/qdrant/broken_images/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..9b54c645b22a9fb5f3fede2fe6529a11f638e35f --- /dev/null +++ b/qdrant/broken_images/meta.json @@ -0,0 +1 @@ +{"collections": {"Broken Images": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/chandalika/collection/Chandalika/storage.sqlite b/qdrant/chandalika/collection/Chandalika/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..f407f6d11e51058915baaab2f3ea6018f057abdb --- /dev/null +++ b/qdrant/chandalika/collection/Chandalika/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3095aba29f6f65cdd96fb1b7242c804c5fd731e435e8cedcb8204a8ef339ce83 +size 278528 diff --git a/qdrant/chandalika/meta.json b/qdrant/chandalika/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..d8c8e9269a6cedbb8bf4f7a0e29d8441f92eb040 --- /dev/null +++ b/qdrant/chandalika/meta.json @@ -0,0 +1 @@ +{"collections": {"Chandalika": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/eveline/collection/Eveline/storage.sqlite b/qdrant/eveline/collection/Eveline/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4d75ec85f9fa71401c3752e5cca09f882b137235 --- /dev/null +++ b/qdrant/eveline/collection/Eveline/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10fcd809f3656f1541c21e8c1746fea89c65e8aa67faceabd8e028d58f4c48bf +size 126976 diff --git a/qdrant/eveline/meta.json b/qdrant/eveline/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..6caadd1336de685957d42d71a5e06d825041a37d --- /dev/null +++ b/qdrant/eveline/meta.json @@ -0,0 +1 @@ +{"collections": {"Eveline": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/film_making/collection/Flim Making/storage.sqlite b/qdrant/film_making/collection/Flim Making/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..40756cf334c9dc4d1053eeb1d4cda3dfbc57d6e0 --- /dev/null +++ b/qdrant/film_making/collection/Flim Making/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2568eae30c5faa4b19c259958638603cacc0866d4ebb64cd4592e321b0ed9e2 +size 217088 diff --git a/qdrant/film_making/meta.json b/qdrant/film_making/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..d34db7837a3600d13cfe050b1d16ffe0b4af46cc --- /dev/null +++ b/qdrant/film_making/meta.json @@ -0,0 +1 @@ +{"collections": {"Flim Making": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/freedom/collection/Freedom/storage.sqlite b/qdrant/freedom/collection/Freedom/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..03c3a26327be1e324301e191cfcbe71da9b70620 --- /dev/null +++ b/qdrant/freedom/collection/Freedom/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7502afa6ac1315c1a4c55bacc7c69ecdf2b44df82cd02007d13d783c22824057 +size 245760 diff --git a/qdrant/freedom/meta.json b/qdrant/freedom/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..0d0876f26f47621390f46930fbd67cc32796bae9 --- /dev/null +++ b/qdrant/freedom/meta.json @@ -0,0 +1 @@ +{"collections": {"Freedom": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/i_sell_my_dreams/collection/I Sell My Dreams/storage.sqlite b/qdrant/i_sell_my_dreams/collection/I Sell My Dreams/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0fc04624435c9ea96a882f3e70d50175a23da5a1 --- /dev/null +++ b/qdrant/i_sell_my_dreams/collection/I Sell My Dreams/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aeef7afad2458147d6657b0aec74455be1277e42f722491c408615024929b30d +size 155648 diff --git a/qdrant/i_sell_my_dreams/meta.json b/qdrant/i_sell_my_dreams/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..ff169c98ee588a3a436b4bf49e368bbb22d6a64b --- /dev/null +++ b/qdrant/i_sell_my_dreams/meta.json @@ -0,0 +1 @@ +{"collections": {"I Sell My Dreams": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/kubla_khan/collection/Kubla Khan/storage.sqlite b/qdrant/kubla_khan/collection/Kubla Khan/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a21cdc50363a4c013546afbd89b7d3772c356776 Binary files /dev/null and b/qdrant/kubla_khan/collection/Kubla Khan/storage.sqlite differ diff --git a/qdrant/kubla_khan/meta.json b/qdrant/kubla_khan/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..741cd878fe730495d05470cbefb632c2267f7926 --- /dev/null +++ b/qdrant/kubla_khan/meta.json @@ -0,0 +1 @@ +{"collections": {"Kubla Khan": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/on_science_fiction/collection/On Science Fiction/storage.sqlite b/qdrant/on_science_fiction/collection/On Science Fiction/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ff60cd3c62be4d4b7ec13a81539f240e3332c97c --- /dev/null +++ b/qdrant/on_science_fiction/collection/On Science Fiction/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d860e2d76c3939b7234fa0fd4a18181722af218cc6d6afef54dede3ac5ab08fe +size 167936 diff --git a/qdrant/on_science_fiction/meta.json b/qdrant/on_science_fiction/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..0ee96272881031df94b551b2de6f82eec40c4017 --- /dev/null +++ b/qdrant/on_science_fiction/meta.json @@ -0,0 +1 @@ +{"collections": {"On Science Fiction": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/on_time/collection/On Time/storage.sqlite b/qdrant/on_time/collection/On Time/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e11e62a4aaf3287e4d2c5323c56de16056452edd Binary files /dev/null and b/qdrant/on_time/collection/On Time/storage.sqlite differ diff --git a/qdrant/on_time/meta.json b/qdrant/on_time/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..5681ea6c04fcb48a626acae1014797db3debec14 --- /dev/null +++ b/qdrant/on_time/meta.json @@ -0,0 +1 @@ +{"collections": {"On Time": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/one_centimeter/collection/One Centimeter/storage.sqlite b/qdrant/one_centimeter/collection/One Centimeter/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..841ef15d3a49e42b27bde4286e4340ac578ea990 --- /dev/null +++ b/qdrant/one_centimeter/collection/One Centimeter/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24ceb548dc8f59aeddd5a8b194006f4602dbee7c6623ae651cfd3ed2c2ca92b9 +size 258048 diff --git a/qdrant/one_centimeter/meta.json b/qdrant/one_centimeter/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..593d1cfd295d560ae13b44f61959781e1512c56f --- /dev/null +++ b/qdrant/one_centimeter/meta.json @@ -0,0 +1 @@ +{"collections": {"One Centimeter": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/poems_by_blake/collection/Poems By Blake/storage.sqlite b/qdrant/poems_by_blake/collection/Poems By Blake/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ef6a3b367b6a3b6b1214dd70da17b8f209f8077c Binary files /dev/null and b/qdrant/poems_by_blake/collection/Poems By Blake/storage.sqlite differ diff --git a/qdrant/poems_by_blake/meta.json b/qdrant/poems_by_blake/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..9032cd175e31b776b16817e57687062d36f20db9 --- /dev/null +++ b/qdrant/poems_by_blake/meta.json @@ -0,0 +1 @@ +{"collections": {"Poems By Blake": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/the_argumentative_indian/collection/The Argumentative Indian/storage.sqlite b/qdrant/the_argumentative_indian/collection/The Argumentative Indian/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0fab9db2f21173bf28edc0b977d98307abcbfeb5 --- /dev/null +++ b/qdrant/the_argumentative_indian/collection/The Argumentative Indian/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:844d2b59f3c1c30a7379744dda887b3881f97ad8d1aba69ba0a035fd5b447bbf +size 208896 diff --git a/qdrant/the_argumentative_indian/meta.json b/qdrant/the_argumentative_indian/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..56f162e25cb97f2676a928c54113b66cb49186e4 --- /dev/null +++ b/qdrant/the_argumentative_indian/meta.json @@ -0,0 +1 @@ +{"collections": {"The Argumentative Indian": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/the_mark_on_the_wall/collection/The Mark On The Wall/storage.sqlite b/qdrant/the_mark_on_the_wall/collection/The Mark On The Wall/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..1177357e6cbdac3829a84f2974a31933b63376e1 --- /dev/null +++ b/qdrant/the_mark_on_the_wall/collection/The Mark On The Wall/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05bbdbe78b639eeb8e5f2f1567adb953a930bfcc1d61c7a8130ad4b183901b7d +size 184320 diff --git a/qdrant/the_mark_on_the_wall/meta.json b/qdrant/the_mark_on_the_wall/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..e37f8c881df4bba927f8efe17c4eb7e478f353eb --- /dev/null +++ b/qdrant/the_mark_on_the_wall/meta.json @@ -0,0 +1 @@ +{"collections": {"The Mark On The Wall": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/the_wild_swans_at_coole/collection/The Wild Swans At Coole/storage.sqlite b/qdrant/the_wild_swans_at_coole/collection/The Wild Swans At Coole/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..14af5b6db2df2008f82e6774d4d325ef8b0065f3 Binary files /dev/null and b/qdrant/the_wild_swans_at_coole/collection/The Wild Swans At Coole/storage.sqlite differ diff --git a/qdrant/the_wild_swans_at_coole/meta.json b/qdrant/the_wild_swans_at_coole/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..6bff68fb8ee64798cd6123377026fd9bd7f01c77 --- /dev/null +++ b/qdrant/the_wild_swans_at_coole/meta.json @@ -0,0 +1 @@ +{"collections": {"The Wild Swans At Coole": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/time_and_time_again/collection/Time And Time Again/storage.sqlite b/qdrant/time_and_time_again/collection/Time And Time Again/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..17e1b45e0850d9d677a74437abbeabbb6d3c3806 Binary files /dev/null and b/qdrant/time_and_time_again/collection/Time And Time Again/storage.sqlite differ diff --git a/qdrant/time_and_time_again/meta.json b/qdrant/time_and_time_again/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..0a41351559234c962027a9044d92ce9cb8fb2c2e --- /dev/null +++ b/qdrant/time_and_time_again/meta.json @@ -0,0 +1 @@ +{"collections": {"Time And Time Again": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/tomorrow/collection/Tomorrow/storage.sqlite b/qdrant/tomorrow/collection/Tomorrow/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..cc9bcddc121548e7192e718ce42a431e94ee211a --- /dev/null +++ b/qdrant/tomorrow/collection/Tomorrow/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:714f5d728a9dc0c247dc740d55f3dc78fc9cee48ce485b02cd3026cb5f1d6ef8 +size 425984 diff --git a/qdrant/tomorrow/meta.json b/qdrant/tomorrow/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..0c0ede4724540a79296d859859c647b63f452be1 --- /dev/null +++ b/qdrant/tomorrow/meta.json @@ -0,0 +1 @@ +{"collections": {"Tomorrow": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/trees/collection/Trees/storage.sqlite b/qdrant/trees/collection/Trees/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..5465f6ccbabea32129efd04ea61ba7b471373739 Binary files /dev/null and b/qdrant/trees/collection/Trees/storage.sqlite differ diff --git a/qdrant/trees/meta.json b/qdrant/trees/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..608cf0f8d617d0d02a2135ee0aacedd446c3e114 --- /dev/null +++ b/qdrant/trees/meta.json @@ -0,0 +1 @@ +{"collections": {"Trees": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/qdrant/why_the_novel_matters/collection/Why The Novel Matters/storage.sqlite b/qdrant/why_the_novel_matters/collection/Why The Novel Matters/storage.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..bbacdd3df241289f8ed61de02be1e6d2225eda82 --- /dev/null +++ b/qdrant/why_the_novel_matters/collection/Why The Novel Matters/storage.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b250fcc55d297811b56a305b0b8a66092f3577123cc636d54f76dd163e98cd39 +size 151552 diff --git a/qdrant/why_the_novel_matters/meta.json b/qdrant/why_the_novel_matters/meta.json new file mode 100644 index 0000000000000000000000000000000000000000..3145a9e3e9cbeadc79a4351e16abca567f4e0896 --- /dev/null +++ b/qdrant/why_the_novel_matters/meta.json @@ -0,0 +1 @@ +{"collections": {"Why The Novel Matters": {"vectors": {"size": 1024, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null, "datatype": null, "multivector_config": null}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null, "strict_mode_config": null}}, "aliases": {}} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..450abf0e6417c96a088f2896338a2b238a6f5959 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +langchain-groq +qdrant-client==1.13.3 +llama-index-embeddings-huggingface==0.5.2 +llama-index-vector-stores-qdrant==0.6.0 +llama-index-core==0.12.28 +langchain_core==0.3.51 +langchain_openai==0.3.12 +llama-index-llms-groq==0.3.1 +pydantic==2.8.0 diff --git a/tree_index_list.pkl b/tree_index_list.pkl new file mode 100644 index 0000000000000000000000000000000000000000..64de6dc9e27f122a67db4f237ae8228d0ad8eb09 --- /dev/null +++ b/tree_index_list.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e7347ac3081de5f6fcd4a31c35b5ea78295b24231e0b6c8392bbaf803d7f97c +size 756782