Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Saberlve/LLM-Kit
/ functions
Functions
60 in github.com/Saberlve/LLM-Kit
⨍
Functions
60
◇
Types & classes
13
↓ 15 callers
Method
progress_callback
(progress: int)
deduplication/qa_deduplication.py:463
↓ 6 callers
Function
generate
(text, Model_Name, prompt_choice, API_KEY, SECRET_KEY=None)
utils/helper.py:81
↓ 5 callers
Method
_log_error
(self, error_message: str, source: str, stack_trace: str = None)
deduplication/qa_deduplication.py:256
↓ 4 callers
Function
log_error
Log error to console and potentially to a database in the future
main.py:25
↓ 3 callers
Method
_report_progress
Report progress if callback is provided
deduplication/qa_deduplication.py:50
↓ 3 callers
Function
extract_qa
(response)
utils/helper.py:67
↓ 2 callers
Method
calculate_similarity
(self, str1: str, str2: str)
quality_control/quality_control.py:67
↓ 1 callers
Method
_create_minhash
Create a MinHash object from text
deduplication/qa_deduplication.py:55
↓ 1 callers
Method
_load_qa_pairs
Load QA pairs from a JSON file
deduplication/qa_deduplication.py:63
↓ 1 callers
Method
_validate_keys
(self)
quality_control/quality_control.py:37
↓ 1 callers
Method
_validate_keys
Validate API key configuration
generate_qas/qa_generator.py:44
↓ 1 callers
Method
calculate_coverage
(self, qa: Dict, nearby_qas: List[Dict])
quality_control/quality_control.py:44
↓ 1 callers
Method
check_coverage_and_regenerate
(self, qa: Dict, nearby_qas: List[Dict], ak: str, sk: str)
quality_control/quality_control.py:144
↓ 1 callers
Method
clean_latex_preserve_titles_bold
Clean LaTeX text, preserving titles and bold content
generate_qas/qa_generator.py:51
↓ 1 callers
Method
clean_result
Clean result text, extract LaTeX content. Args: text (str): Original text. Returns: str: Cleaned La
text_parse/to_tex.py:115
↓ 1 callers
Method
convert_tex_to_qas
Convert LaTeX file to QA pairs and save
generate_qas/qa_generator.py:176
↓ 1 callers
Method
convert_to_latex
Convert parsed file content to LaTeX format
text_parse/to_tex.py:49
↓ 1 callers
Function
dedup
Run the deduplication process
main.py:31
↓ 1 callers
Method
evaluate_qa_and_regenerate
(self, qa: Dict, nearby_qas: List[Dict], ak: str, sk: str)
quality_control/quality_control.py:120
↓ 1 callers
Method
filter_text
Filter invalid text, rules to be added
generate_qas/qa_generator.py:90
↓ 1 callers
Method
find_suitable_qa
(self, new_qas: List[Dict], nearby_qas: List[Dict])
quality_control/quality_control.py:84
↓ 1 callers
Method
from_dedup_yaml
(cls, dedup_yaml_path: str)
utils/hparams.py:40
↓ 1 callers
Method
from_hparams
(cls, hparams_name_or_path: str)
utils/hparams.py:21
↓ 1 callers
Function
generate_Qwen
(text, API_KEY, prompt_choice)
model_api/Qwen/Qwen.py:7
↓ 1 callers
Function
generate_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 callers
Function
generate_flash
(text, API_KEY, prompt_choice)
model_api/flash/flash.py:9
↓ 1 callers
Function
generate_lite
(text, API_KEY, prompt_choice)
model_api/lite/lite.py:6
↓ 1 callers
Method
generate_more_qas
(self, qa: Dict, nearby_qas: List[Dict], ak: str, sk: str)
quality_control/quality_control.py:108
↓ 1 callers
Function
get_access_token
(API_KEY,SECRET_KEY)
model_api/erine/erine.py:53
↓ 1 callers
Method
get_nearby_qas
(qas: List[Dict], i: int)
quality_control/quality_control.py:217
↓ 1 callers
Method
get_quality_content_by_filename
Get quality file content based on filename
deduplication/qa_deduplication.py:337
↓ 1 callers
Method
get_text_between_titles
Get text between titles, i.e., text between two LaTeX section headings
generate_qas/qa_generator.py:81
↓ 1 callers
Method
is_explicit
(self, question: str, ak: str, sk: str)
quality_control/quality_control.py:77
↓ 1 callers
Method
is_relative
(self, question: str, ak: str, sk: str)
quality_control/quality_control.py:70
↓ 1 callers
Method
iterate_optim_qa
(self)
quality_control/quality_control.py:152
↓ 1 callers
Function
main
()
main.py:54
↓ 1 callers
Function
parse
File parsing function, supports progress callback :param hparams: Hyperparameters :param progress_callback: Progress callback function
text_parse/parse.py:112
↓ 1 callers
Function
pdf_parse
PDF file parsing, supports progress callback
text_parse/parse.py:51
↓ 1 callers
Method
process_qa_file
Process QA file to deduplicate QA pairs. Args: hparams: Deduplication parameters Returns: Tuple con
deduplication/qa_deduplication.py:79
↓ 1 callers
Method
regenerate_qa
(self, qa: Dict, nearby_qas: List[Dict], ak: str, sk: str)
quality_control/quality_control.py:95
↓ 1 callers
Function
run_all
Run both main processing and deduplication
main.py:104
↓ 1 callers
Function
single_ocr
(file_path)
text_parse/parse.py:10
↓ 1 callers
Function
split_chunk_by_tokens
(chunk: str, max_tokens: int)
utils/helper.py:11
↓ 1 callers
Function
split_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
Method
deduplicate_qa
(self, filenames: List[str], dedup_by_answer: bool, dedup_threshold: float, min_ans
deduplication/qa_deduplication.py:389
Method
get_dedup_content
Get deduplicated file content based on file ID
deduplication/qa_deduplication.py:310
Method
get_dedup_content_by_filename
Get deduplicated file content based on filename
deduplication/qa_deduplication.py:362
Method
get_dedup_records
Get the most recent deduplication history record
deduplication/qa_deduplication.py:612
Method
get_quality_content
Get quality file content based on file ID
deduplication/qa_deduplication.py:285
Method
process_chunk_with_api
Process a single text chunk and update progress
text_parse/to_tex.py:22
Method
process_chunk_with_api
Process a single text chunk and update progress
generate_qas/qa_generator.py:105
Method
process_latex_chunk
Process LaTeX chunk and generate QA pairs :param latex: LaTeX text :return: List of QA pairs
generate_qas/qa_generator.py:135
Function
text_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
Method
update_progress
Update progress (with throttling control)
deduplication/qa_deduplication.py:272