Spaces:
Sleeping
Sleeping
apple muncy commited on
Commit ยท
bbadaec
1
Parent(s): bb8fbdc
add logging to app.py
Browse filesSigned-off-by: apple muncy <apple@dell-deb-12-5.local>
app.py
CHANGED
|
@@ -11,6 +11,14 @@ import uvicorn
|
|
| 11 |
from pydantic import BaseModel
|
| 12 |
from huggingface_hub.inference._mcp.agent import Agent
|
| 13 |
from dotenv import load_dotenv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
load_dotenv()
|
| 16 |
|
|
@@ -518,6 +526,7 @@ app = gr.mount_gradio_app(app, gradio_app, path="/gradio")
|
|
| 518 |
|
| 519 |
|
| 520 |
if __name__ == "__main__":
|
|
|
|
| 521 |
print("๐ Starting HF Tagging Bot...")
|
| 522 |
print("๐ Dashboard: http://localhost:7860/gradio")
|
| 523 |
print("๐ Webhook: http://localhost:7860/webhook")
|
|
|
|
| 11 |
from pydantic import BaseModel
|
| 12 |
from huggingface_hub.inference._mcp.agent import Agent
|
| 13 |
from dotenv import load_dotenv
|
| 14 |
+
#add logging
|
| 15 |
+
import logging
|
| 16 |
+
logger = logging.getLogger(__name__)
|
| 17 |
+
logging.basicConfig(filename='tag.log', encoding='utf-8', level=logging.DEBUG)
|
| 18 |
+
logger.debug('This message should go to the log file')
|
| 19 |
+
logger.info('So should this')
|
| 20 |
+
logger.warning('And this, too')
|
| 21 |
+
logger.error('And non-ASCII stuff, too, like รresund and Malmรถ')
|
| 22 |
|
| 23 |
load_dotenv()
|
| 24 |
|
|
|
|
| 526 |
|
| 527 |
|
| 528 |
if __name__ == "__main__":
|
| 529 |
+
logger.info('๐ Starting HF Tagging Bot...')
|
| 530 |
print("๐ Starting HF Tagging Bot...")
|
| 531 |
print("๐ Dashboard: http://localhost:7860/gradio")
|
| 532 |
print("๐ Webhook: http://localhost:7860/webhook")
|