Skip to content

Commit 208ad76

Browse files
feat: Add image asset and update logging configuration for improved handler management
1 parent 1975534 commit 208ad76

4 files changed

Lines changed: 15 additions & 12 deletions

File tree

docs/images/1.png

93.8 KB
Loading

quantllm/hub/hub_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ def push(self, commit_message: str = "Upload model via QuantLLM"):
185185
print_error(f"Error pushing to Hub: {str(e)}")
186186
raise
187187

188-
# Legacy compatibility (optional)
188+
# Legacy compatibility
189189
def push_model(self, *args, **kwargs):
190-
"""Legacy method alias."""
191-
print_info("Using legacy push_model compatibility")
192-
pass # Not implementing full legacy logic unless needed
190+
"""Legacy method alias — delegates to push()."""
191+
print_warning("push_model() is deprecated. Use push() instead.")
192+
return self.push(*args, **kwargs)

quantllm/hub/model_card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def _generate_details_section(self) -> str:
427427
| **Quantization** | {self.quantization or "Full Precision"} |
428428
| **License** | `{self.license}` |
429429
| **Export Date** | {datetime.now().strftime("%Y-%m-%d")} |
430-
| **Exported By** | [QuantLLM v2.0](https://github.com/codewithdark-git/QuantLLM) |
430+
| **Exported By** | [QuantLLM v2.1](https://github.com/codewithdark-git/QuantLLM) |
431431
'''
432432

433433
def _generate_quantization_section(self) -> str:

quantllm/utils/progress.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,16 @@
6262
# ============================================
6363

6464
def configure_logging(level: str = "INFO") -> None:
65-
"""Configure rich-based logging."""
66-
logging.basicConfig(
67-
level=level,
68-
format="%(message)s",
69-
datefmt="[%X]",
70-
handlers=[RichHandler(console=console, rich_tracebacks=True, markup=True, show_path=False)]
71-
)
65+
"""Configure rich-based logging. Safe to call multiple times."""
66+
root_logger = logging.getLogger()
67+
# Remove existing RichHandlers to avoid duplicates
68+
root_logger.handlers = [
69+
h for h in root_logger.handlers if not isinstance(h, RichHandler)
70+
]
71+
root_logger.setLevel(level)
72+
handler = RichHandler(console=console, rich_tracebacks=True, markup=True, show_path=False)
73+
handler.setLevel(level)
74+
root_logger.addHandler(handler)
7275

7376
def get_logger(name: str = "quantllm") -> logging.Logger:
7477
"""Get the project logger."""

0 commit comments

Comments
 (0)