MCPcopy Create free account

hub / github.com/Saberlve/LLM-Kit / functions

Functions60 in github.com/Saberlve/LLM-Kit

↓ 15 callersMethodprogress_callback
(progress: int)
deduplication/qa_deduplication.py:463
↓ 6 callersFunctiongenerate
(text, Model_Name, prompt_choice, API_KEY, SECRET_KEY=None)
utils/helper.py:81
↓ 5 callersMethod_log_error
(self, error_message: str, source: str, stack_trace: str = None)
deduplication/qa_deduplication.py:256
↓ 4 callersFunctionlog_error
Log error to console and potentially to a database in the future
main.py:25
↓ 3 callersMethod_report_progress
Report progress if callback is provided
deduplication/qa_deduplication.py:50
↓ 3 callersFunctionextract_qa
(response)
utils/helper.py:67
↓ 2 callersMethodcalculate_similarity
(self, str1: str, str2: str)
quality_control/quality_control.py:67
↓ 1 callersMethod_create_minhash
Create a MinHash object from text
deduplication/qa_deduplication.py:55
↓ 1 callersMethod_load_qa_pairs
Load QA pairs from a JSON file
deduplication/qa_deduplication.py:63
↓ 1 callersMethod_validate_keys
(self)
quality_control/quality_control.py:37
↓ 1 callersMethod_validate_keys
Validate API key configuration
generate_qas/qa_generator.py:44
↓ 1 callersMethodcalculate_coverage
(self, qa: Dict, nearby_qas: List[Dict])
quality_control/quality_control.py:44
↓ 1 callersMethodcheck_coverage_and_regenerate
(self, qa: Dict, nearby_qas: List[Dict], ak: str, sk: str)
quality_control/quality_control.py:144
↓ 1 callersMethodclean_latex_preserve_titles_bold
Clean LaTeX text, preserving titles and bold content
generate_qas/qa_generator.py:51
↓ 1 callersMethodclean_result
Clean result text, extract LaTeX content. Args: text (str): Original text. Returns: str: Cleaned La
text_parse/to_tex.py:115
↓ 1 callersMethodconvert_tex_to_qas
Convert LaTeX file to QA pairs and save
generate_qas/qa_generator.py:176
↓ 1 callersMethodconvert_to_latex
Convert parsed file content to LaTeX format
text_parse/to_tex.py:49
↓ 1 callersFunctiondedup
Run the deduplication process
main.py:31
↓ 1 callersMethodevaluate_qa_and_regenerate
(self, qa: Dict, nearby_qas: List[Dict], ak: str, sk: str)
quality_control/quality_control.py:120
↓ 1 callersMethodfilter_text
Filter invalid text, rules to be added
generate_qas/qa_generator.py:90
↓ 1 callersMethodfind_suitable_qa
(self, new_qas: List[Dict], nearby_qas: List[Dict])
quality_control/quality_control.py:84
↓ 1 callersMethodfrom_dedup_yaml
(cls, dedup_yaml_path: str)
utils/hparams.py:40
↓ 1 callersMethodfrom_hparams
(cls, hparams_name_or_path: str)
utils/hparams.py:21
↓ 1 callersFunctiongenerate_Qwen
(text, API_KEY, prompt_choice)
model_api/Qwen/Qwen.py:7
↓ 1 callersFunctiongenerate_erine
Call the model based on prompt and API keys :param text: Input text :param API_KEY: API key :param SECRET_KEY: Secret key :param
model_api/erine/erine.py:8
↓ 1 callersFunctiongenerate_flash
(text, API_KEY, prompt_choice)
model_api/flash/flash.py:9
↓ 1 callersFunctiongenerate_lite
(text, API_KEY, prompt_choice)
model_api/lite/lite.py:6
↓ 1 callersMethodgenerate_more_qas
(self, qa: Dict, nearby_qas: List[Dict], ak: str, sk: str)
quality_control/quality_control.py:108
↓ 1 callersFunctionget_access_token
(API_KEY,SECRET_KEY)
model_api/erine/erine.py:53
↓ 1 callersMethodget_nearby_qas
(qas: List[Dict], i: int)
quality_control/quality_control.py:217
↓ 1 callersMethodget_quality_content_by_filename
Get quality file content based on filename
deduplication/qa_deduplication.py:337
↓ 1 callersMethodget_text_between_titles
Get text between titles, i.e., text between two LaTeX section headings
generate_qas/qa_generator.py:81
↓ 1 callersMethodis_explicit
(self, question: str, ak: str, sk: str)
quality_control/quality_control.py:77
↓ 1 callersMethodis_relative
(self, question: str, ak: str, sk: str)
quality_control/quality_control.py:70
↓ 1 callersMethoditerate_optim_qa
(self)
quality_control/quality_control.py:152
↓ 1 callersFunctionmain
()
main.py:54
↓ 1 callersFunctionparse
File parsing function, supports progress callback :param hparams: Hyperparameters :param progress_callback: Progress callback function
text_parse/parse.py:112
↓ 1 callersFunctionpdf_parse
PDF file parsing, supports progress callback
text_parse/parse.py:51
↓ 1 callersMethodprocess_qa_file
Process QA file to deduplicate QA pairs. Args: hparams: Deduplication parameters Returns: Tuple con
deduplication/qa_deduplication.py:79
↓ 1 callersMethodregenerate_qa
(self, qa: Dict, nearby_qas: List[Dict], ak: str, sk: str)
quality_control/quality_control.py:95
↓ 1 callersFunctionrun_all
Run both main processing and deduplication
main.py:104
↓ 1 callersFunctionsingle_ocr
(file_path)
text_parse/parse.py:10
↓ 1 callersFunctionsplit_chunk_by_tokens
(chunk: str, max_tokens: int)
utils/helper.py:11
↓ 1 callersFunctionsplit_text_into_chunks
(parallel_num, text: str)
utils/helper.py:43
Method__init__
(self, qa_path: str, hparams: HyperParams, progress_callback=None)
quality_control/quality_control.py:16
Method__init__
(self, parsed_file_path, hparams: HyperParams, progress_callback=None)
text_parse/to_tex.py:11
Method__init__
Initialize the QA deduplication class. Args: hparams: Deduplication parameters progress_callback: Optional c
deduplication/qa_deduplication.py:35
Method__init__
(self, db: AsyncIOMotorClient)
deduplication/qa_deduplication.py:244
Method__post_init__
Additional setup after initialization
generate_qas/qa_generator.py:34
Method_generate_output_paths
Generate output file paths
deduplication/qa_deduplication.py:265
Methoddeduplicate_qa
(self, filenames: List[str], dedup_by_answer: bool, dedup_threshold: float, min_ans
deduplication/qa_deduplication.py:389
Methodget_dedup_content
Get deduplicated file content based on file ID
deduplication/qa_deduplication.py:310
Methodget_dedup_content_by_filename
Get deduplicated file content based on filename
deduplication/qa_deduplication.py:362
Methodget_dedup_records
Get the most recent deduplication history record
deduplication/qa_deduplication.py:612
Methodget_quality_content
Get quality file content based on file ID
deduplication/qa_deduplication.py:285
Methodprocess_chunk_with_api
Process a single text chunk and update progress
text_parse/to_tex.py:22
Methodprocess_chunk_with_api
Process a single text chunk and update progress
generate_qas/qa_generator.py:105
Methodprocess_latex_chunk
Process LaTeX chunk and generate QA pairs :param latex: LaTeX text :return: List of QA pairs
generate_qas/qa_generator.py:135
Functiontext_parse
Text document parsing, which is essentially making a copy of the file :param file_path: Original file path :param save_path: Path for the
text_parse/parse.py:24
Methodupdate_progress
Update progress (with throttling control)
deduplication/qa_deduplication.py:272