-
Notifications
You must be signed in to change notification settings - Fork 32
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
LLamaIndex Integration #12
base: main
Are you sure you want to change the base?
Conversation
gallegi
commented
Nov 22, 2024
•
edited
Loading
edited
- LlamaIndex integration using workflow
- Continue conversation (ask follow-up questions)
- RAG pipeline, allow dropping multiple pdf, doc, txt files and ask related questions
- Fix text cut off in the chat box
- Be able to display markdown in the chat box
…upload; Continue conversation with chat history
self.node_processor = SimilarityPostprocessor(similarity_cutoff=0.3) | ||
self.llm = llm | ||
|
||
def udpate_index(self, files: Optional[Set[str] ] = set()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be update_index
?
|
||
@step | ||
async def setup(self, ctx: Context, ev: StartEvent) -> SetupEvent: | ||
# set frequetly used variables to context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frequently
?
messages=[{"role": "user", "content": message}], stream=stream | ||
) | ||
|
||
import asyncio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move import to top?
@@ -9,21 +10,31 @@ class ProcessingThread(QThread): | |||
update_signal = pyqtSignal(str) | |||
finished_signal = pyqtSignal() | |||
|
|||
def __init__(self, model, prompt, image=None): | |||
def __init__(self, model, prompt, lookup_files=set(), image=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using set() as a default parameter value can be dangerous because it creates a mutable default argument, which is a common Python pitfall. The same set object will be shared across all instances of the class. Instead, use None and create the set inside the method:
def __init__(self, model, prompt, lookup_files=None, image=None):
self.lookup_files = set() if lookup_files is None else lookup_files
document_icon = "llama_assistant/resources/document_icon.png" | ||
|
||
# for RAG pipeline | ||
embed_model_name = "BAAI/bge-base-en-v1.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a TODO: Make it configurable next time.
@@ -7,4 +8,8 @@ huggingface_hub==0.25.1 | |||
openwakeword==0.6.0 | |||
pyinstaller==6.10.0 | |||
ffmpeg-python==0.2.0 | |||
llama-index-core==0.12.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new requirements to pyproject.toml
to be installable from PyPi.
Error due to missing package:
|
Error while inference:
File: Question:
Fix: This works when I update all context length ( TODO: Make it configurable. |
Implementing #13. |