Fix linting
This commit is contained in:
@@ -13,18 +13,6 @@ from fastapi import (
|
|||||||
from typing import Dict
|
from typing import Dict
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
# Global progress tracker
|
|
||||||
scan_progress: Dict = {
|
|
||||||
"is_scanning": False,
|
|
||||||
"current_file": "",
|
|
||||||
"indexed_count": 0,
|
|
||||||
"total_files": 0,
|
|
||||||
"progress": 0,
|
|
||||||
}
|
|
||||||
|
|
||||||
# Lock for thread-safe operations
|
|
||||||
progress_lock = threading.Lock()
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -34,7 +22,7 @@ import logging
|
|||||||
import argparse
|
import argparse
|
||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
from typing import List, Dict, Any, Optional, Union
|
from typing import List, Any, Optional, Union
|
||||||
from lightrag import LightRAG, QueryParam
|
from lightrag import LightRAG, QueryParam
|
||||||
from lightrag.api import __api_version__
|
from lightrag.api import __api_version__
|
||||||
|
|
||||||
@@ -57,8 +45,21 @@ import pipmaster as pm
|
|||||||
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
# Load environment variables
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
# Global progress tracker
|
||||||
|
scan_progress: Dict = {
|
||||||
|
"is_scanning": False,
|
||||||
|
"current_file": "",
|
||||||
|
"indexed_count": 0,
|
||||||
|
"total_files": 0,
|
||||||
|
"progress": 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
# Lock for thread-safe operations
|
||||||
|
progress_lock = threading.Lock()
|
||||||
|
|
||||||
|
|
||||||
def estimate_tokens(text: str) -> int:
|
def estimate_tokens(text: str) -> int:
|
||||||
"""Estimate the number of tokens in text
|
"""Estimate the number of tokens in text
|
||||||
|
Reference in New Issue
Block a user