Skip to content

Commit

Permalink
basic error fix, added to an irrelevant branch
Browse files Browse the repository at this point in the history
  • Loading branch information
eren23 committed Apr 17, 2023
1 parent 5bf20cf commit 0f6e995
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/audio_to_text_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class AudioToTextExtractor(BaseExtractor):
"""

def __init__(self, audio_path: str, embedding_extractor='hf', model_lang='en', is_turbo: bool = False,
verbose: bool = False, index_path: str = None, index_type: str = "basic"):
verbose: bool = False, index_path: str = None, index_type: str = "basic", strict_context: bool = False, is_gpt4: bool = False, prompt_template: str = None):
super().__init__(embedding_extractor=embedding_extractor, model_lang=model_lang, is_turbo=is_turbo,
verbose=verbose, index_path=index_path, index_type=index_type)
verbose=verbose, index_path=index_path, index_type=index_type, is_gpt4=is_gpt4, prompt_template=prompt_template, strict_context=strict_context)
self.audio_path = audio_path

def prepare_df(self):
Expand Down
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class BaseAgent(BaseExtractor):
"""

def __init__(self, dataframe=None, embedding_extractor="hf", model_lang="en", is_turbo=False, index_type="basic",
verbose=False, index_path=None, is_gpt4=False, prompt_template=None, task_type="image_generation", hf_token=None):
verbose=False, index_path=None, is_gpt4=False, prompt_template=None, task_type="image_generation", hf_token=None, strict_context: bool = False):
super().__init__(dataframe=dataframe, embedding_extractor=embedding_extractor, model_lang=model_lang,
is_turbo=is_turbo, index_type=index_type, verbose=verbose, index_path=index_path, is_gpt4=is_gpt4,
prompt_template=prompt_template)
prompt_template=prompt_template, strict_context=strict_context)

self.hf_token = hf_token
self.task_type = task_type
Expand Down
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/docs_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class DocsExtractor(BaseExtractor):
"""

def __init__(self, file_path: str, embedding_extractor: str = "hf", model_lang: str = "en", is_turbo: bool = False,
verbose: bool = False, index_path: str = None, index_type: str = "basic"):
verbose: bool = False, index_path: str = None, index_type: str = "basic", strict_context: bool = False, is_gpt4: bool = False, prompt_template: str = None):
super().__init__(embedding_extractor=embedding_extractor, model_lang=model_lang, is_turbo=is_turbo,
verbose=verbose, index_path=index_path, index_type=index_type)
verbose=verbose, index_path=index_path, index_type=index_type, is_gpt4=is_gpt4, prompt_template=prompt_template, strict_context=strict_context)
self.file_path = file_path


Expand Down
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/hybrid_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

class HybridFileExtractpr(BaseExtractor):
def __init__(self, directory_path: str, extraction_type: str = "page", embedding_extractor: str = "hf",
model_lang: str = "en", is_turbo: bool = False, verbose: bool = False, index_path: str = None, index_type: str = "basic"):
model_lang: str = "en", is_turbo: bool = False, verbose: bool = False, index_path: str = None, index_type: str = "basic", strict_context: bool = False, is_gpt4: bool = False, prompt_template: str = None):
"""
Extracts paragraphs from a PDF file and computes embeddings for each paragraph,
then answers a query using the embeddings.
"""
super().__init__(embedding_extractor=embedding_extractor, model_lang=model_lang, is_turbo=is_turbo,
verbose=verbose, index_path=index_path, index_type=index_type)
verbose=verbose, index_path=index_path, index_type=index_type, is_gpt4=is_gpt4, prompt_template=prompt_template, strict_context=strict_context)

self.directory_path = directory_path
self.extraction_type = extraction_type
Expand Down
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/pdf_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

class PDFExtractor(BaseExtractor):
def __init__(self, pdf_file_path: str, extraction_type: str = "page", embedding_extractor: str = "hf",
model_lang: str = "en", is_turbo: bool = False, verbose: bool = False, index_path: str = None, index_type: str = "basic", strict_context: bool = False):
model_lang: str = "en", is_turbo: bool = False, verbose: bool = False, index_path: str = None, index_type: str = "basic", strict_context: bool = False, is_gpt4: bool = False, prompt_template: str = None):
"""
Extracts paragraphs from a PDF file and computes embeddings for each paragraph,
then answers a query using the embeddings.
"""
super().__init__(embedding_extractor=embedding_extractor, model_lang=model_lang, is_turbo=is_turbo,
verbose=verbose, index_path=index_path, index_type=index_type, strict_context=strict_context)
verbose=verbose, index_path=index_path, index_type=index_type,is_gpt4=is_gpt4, prompt_template=prompt_template, strict_context=strict_context)

self.pdf_file_path = pdf_file_path
self.extraction_type = extraction_type
Expand Down
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/powerpoint_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class PowerpointExtractor(BaseExtractor):
"""

def __init__(self, file_path, embedding_extractor: str = "hf", model_lang: str = "en", is_turbo: bool = False,
verbose: bool = False, index_path: str = None, index_type: str = "basic"):
verbose: bool = False, index_path: str = None, index_type: str = "basic", strict_context: bool = False, is_gpt4: bool = False, prompt_template: str = None):

super().__init__(embedding_extractor=embedding_extractor, model_lang=model_lang, is_turbo=is_turbo,
verbose=verbose, index_path=index_path, index_type=index_type)
verbose=verbose, index_path=index_path, index_type=index_type, is_gpt4=is_gpt4, prompt_template=prompt_template, strict_context=strict_context)
self.file_path = file_path


Expand Down
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/web_scrape_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class WebScrapeExtractor(BaseExtractor):
"""

def __init__(self, url, embedding_extractor: str, model_lang: str, is_turbo: bool = False, verbose: bool = False,
index_path: str = None, index_type: str = "basic"):
index_path: str = None, index_type: str = "basic", strict_context: bool = False, is_gpt4: bool = False, prompt_template: str = None):
super().__init__(embedding_extractor=embedding_extractor, model_lang=model_lang, is_turbo=is_turbo,
verbose=verbose, index_path=index_path, index_type=index_type)
verbose=verbose, index_path=index_path, index_type=index_type, is_gpt4=is_gpt4, prompt_template=prompt_template, strict_context=strict_context)
self.url = url

def prepare_df(self):
Expand Down
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/yt_audio_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class YoutubeAudioExtractor(BaseExtractor):
"""

def __init__(self, video_id: str, embedding_extractor='hf', model_lang='en', is_turbo: bool = False,
verbose: bool = False, index_path: str = None, index_type: str = "basic", is_playlist: bool = False):
verbose: bool = False, index_path: str = None, index_type: str = "basic", is_playlist: bool = False, strict_context: bool = False, is_gpt4: bool = False, prompt_template: str = None):
super().__init__(embedding_extractor=embedding_extractor, model_lang=model_lang, is_turbo=is_turbo,
verbose=verbose, index_path=index_path, index_type=index_type)
verbose=verbose, index_path=index_path, index_type=index_type, is_gpt4=is_gpt4, prompt_template=prompt_template, strict_context=strict_context)
self.video_id = video_id
self.is_playlist = is_playlist

Expand Down
4 changes: 2 additions & 2 deletions knowledgegpt/extractors/yt_subs_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class YTSubsExtractor(BaseExtractor):
"""

def __init__(self, video_id: str, model_lang="en", embedding_extractor="hf", is_turbo: bool = False,
verbose: bool = False, index_path: str = None, index_type: str = "basic", is_playlist: bool = False):
verbose: bool = False, index_path: str = None, index_type: str = "basic", is_playlist: bool = False, strict_context: bool = False, is_gpt4: bool = False, prompt_template: str = None):
super().__init__(embedding_extractor=embedding_extractor, model_lang=model_lang, is_turbo=is_turbo,
verbose=verbose, index_path=index_path, index_type=index_type)
verbose=verbose, index_path=index_path, index_type=index_type, is_gpt4=is_gpt4, prompt_template=prompt_template, strict_context=strict_context)
self.video_id = video_id
self.is_playlist = is_playlist

Expand Down

0 comments on commit 0f6e995

Please sign in to comment.