-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sourcery refactored main branch #1
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,11 @@ | |
# Load embeddings and DeepLake database | ||
def load_embeddings_and_database(active_loop_data_set_path): | ||
embeddings = OpenAIEmbeddings() | ||
db = DeepLake( | ||
return DeepLake( | ||
dataset_path=active_loop_data_set_path, | ||
read_only=True, | ||
embedding_function=embeddings | ||
embedding_function=embeddings, | ||
) | ||
return db | ||
|
||
# Transcribe audio using OpenAI Whisper API | ||
def transcribe_audio(audio_file_path, openai_key): | ||
|
@@ -88,7 +87,7 @@ def search_db(user_input, db): | |
# Display conversation history using Streamlit messages | ||
def display_conversation(history): | ||
for i in range(len(history["generated"])): | ||
message(history["past"][i], is_user=True, key=str(i) + "_user") | ||
message(history["past"][i], is_user=True, key=f"{str(i)}_user") | ||
Comment on lines
-91
to
+90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
message(history["generated"][i],key=str(i)) | ||
#Voice using Eleven API | ||
voice= "Bella" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,9 +90,7 @@ def split_docs(docs): | |
def load_vectors_into_deeplake(dataset_path, source_chunks): | ||
# Initialize the DeepLake database with the dataset path and embedding function | ||
deeplake_db = DeepLake(dataset_path=dataset_path, embedding_function=embeddings) | ||
# Add the text chunks to the database | ||
deeplakedb=deeplake_db.add_texts(source_chunks) | ||
return deeplakedb | ||
return deeplake_db.add_texts(source_chunks) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
This removes the following comments ( why? ):
|
||
|
||
|
||
# Define the main function | ||
|
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.
Function
load_embeddings_and_database
refactored with the following changes:inline-immediately-returned-variable
)