Update repo_explorer.py
Browse files- repo_explorer.py +4 -4
repo_explorer.py
CHANGED
@@ -324,7 +324,7 @@ def generate_repo_link_html(repo_id: str) -> str:
|
|
324 |
def handle_load_repository_with_vectorization(repo_id: str) -> Tuple[str, str, gr.HTML]:
|
325 |
"""Load repository and create both context summary and vector embeddings."""
|
326 |
if not repo_id.strip():
|
327 |
-
return "Status: Please enter a repository ID.", "", gr.
|
328 |
|
329 |
try:
|
330 |
logger.info(f"Loading repository with vectorization: {repo_id}")
|
@@ -336,7 +336,7 @@ def handle_load_repository_with_vectorization(repo_id: str) -> Tuple[str, str, g
|
|
336 |
except Exception as e:
|
337 |
logger.error(f"Error downloading repository {repo_id}: {e}")
|
338 |
error_status = f"β Error downloading repository: {e}"
|
339 |
-
return error_status, "", gr.
|
340 |
|
341 |
# Read the combined content
|
342 |
with open(combined_text_path, "r", encoding="utf-8") as f:
|
@@ -359,12 +359,12 @@ def handle_load_repository_with_vectorization(repo_id: str) -> Tuple[str, str, g
|
|
359 |
repo_link_html = generate_repo_link_html(repo_id)
|
360 |
|
361 |
logger.info(f"Repository {repo_id} loaded and processed successfully")
|
362 |
-
return status, context_summary, gr.
|
363 |
|
364 |
except Exception as e:
|
365 |
logger.error(f"Error loading repository {repo_id}: {e}")
|
366 |
error_status = f"β Error loading repository: {e}"
|
367 |
-
return error_status, "", gr.
|
368 |
|
369 |
def initialize_repo_chatbot(repo_status: str, repo_id: str, repo_context_summary: str) -> List[Dict[str, str]]:
|
370 |
"""Initialize the repository chatbot with a welcome message after successful repo loading."""
|
|
|
324 |
def handle_load_repository_with_vectorization(repo_id: str) -> Tuple[str, str, gr.HTML]:
|
325 |
"""Load repository and create both context summary and vector embeddings."""
|
326 |
if not repo_id.strip():
|
327 |
+
return "Status: Please enter a repository ID.", "", gr.update(value="", visible=False)
|
328 |
|
329 |
try:
|
330 |
logger.info(f"Loading repository with vectorization: {repo_id}")
|
|
|
336 |
except Exception as e:
|
337 |
logger.error(f"Error downloading repository {repo_id}: {e}")
|
338 |
error_status = f"β Error downloading repository: {e}"
|
339 |
+
return error_status, "", gr.update(value="", visible=False)
|
340 |
|
341 |
# Read the combined content
|
342 |
with open(combined_text_path, "r", encoding="utf-8") as f:
|
|
|
359 |
repo_link_html = generate_repo_link_html(repo_id)
|
360 |
|
361 |
logger.info(f"Repository {repo_id} loaded and processed successfully")
|
362 |
+
return status, context_summary, gr.update(value=repo_link_html, visible=True)
|
363 |
|
364 |
except Exception as e:
|
365 |
logger.error(f"Error loading repository {repo_id}: {e}")
|
366 |
error_status = f"β Error loading repository: {e}"
|
367 |
+
return error_status, "", gr.update(value="", visible=False)
|
368 |
|
369 |
def initialize_repo_chatbot(repo_status: str, repo_id: str, repo_context_summary: str) -> List[Dict[str, str]]:
|
370 |
"""Initialize the repository chatbot with a welcome message after successful repo loading."""
|