Spaces:
Sleeping
Sleeping
apple muncy commited on
Commit ·
b3fe4f7
1
Parent(s): bbadaec
changed logger to loggerS
Browse filesSigned-off-by: apple muncy <apple@dell-deb-12-5.local>
- mcp_server.py +7 -7
mcp_server.py
CHANGED
|
@@ -12,13 +12,13 @@ from dotenv import load_dotenv
|
|
| 12 |
|
| 13 |
#adding logger
|
| 14 |
import logging
|
| 15 |
-
|
| 16 |
logging.basicConfig(filename='tag.log', encoding='utf-8', level=logging.DEBUG)
|
| 17 |
#for testing logger
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
load_dotenv()
|
| 24 |
|
|
@@ -36,7 +36,7 @@ mcp = FastMCP("hf-tagging-bot")
|
|
| 36 |
def get_current_tags(repo_id: str) -> str:
|
| 37 |
"""Get current tags from a HuggingFace model repository"""
|
| 38 |
print(f"🔧 get_current_tags called with repo_id: {repo_id}")
|
| 39 |
-
|
| 40 |
if not hf_api:
|
| 41 |
error_result = {"error": "HF token not configured"}
|
| 42 |
json_str = json.dumps(error_result)
|
|
@@ -192,5 +192,5 @@ This PR adds the `{new_tag}` tag to the model repository.
|
|
| 192 |
|
| 193 |
|
| 194 |
if __name__ == "__main__":
|
| 195 |
-
|
| 196 |
mcp.run()
|
|
|
|
| 12 |
|
| 13 |
#adding logger
|
| 14 |
import logging
|
| 15 |
+
loggerS = logging.getLogger(__name__)
|
| 16 |
logging.basicConfig(filename='tag.log', encoding='utf-8', level=logging.DEBUG)
|
| 17 |
#for testing logger
|
| 18 |
+
loggerS.debug('This message should go to the log file')
|
| 19 |
+
loggerS.info('So should this')
|
| 20 |
+
loggerS.warning('And this, too')
|
| 21 |
+
loggerS.error('And non-ASCII stuff, too, like Øresund and Malmö')
|
| 22 |
|
| 23 |
load_dotenv()
|
| 24 |
|
|
|
|
| 36 |
def get_current_tags(repo_id: str) -> str:
|
| 37 |
"""Get current tags from a HuggingFace model repository"""
|
| 38 |
print(f"🔧 get_current_tags called with repo_id: {repo_id}")
|
| 39 |
+
loggerS.info('🔧 get_current_tags called with repo_id %s', {repo_id})
|
| 40 |
if not hf_api:
|
| 41 |
error_result = {"error": "HF token not configured"}
|
| 42 |
json_str = json.dumps(error_result)
|
|
|
|
| 192 |
|
| 193 |
|
| 194 |
if __name__ == "__main__":
|
| 195 |
+
loggerS.info('main mcp-server')
|
| 196 |
mcp.run()
|