Skip to content

Commit

Permalink
Add debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mareklibra committed Oct 23, 2024
1 parent afdf0b7 commit 770fdb1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
from lib.retriever import Retriever
from lib.validator import OutputValidator
from lib.serverless_validation import ServerlessValidation

from langchain.globals import set_debug

from flask import Flask, g

logging.basicConfig(stream=sys.stderr, level=os.environ.get('LOG_LEVEL', 'INFO').upper())
def setup_logging():
log_level = os.environ.get('LOG_LEVEL', 'INFO').upper()
logging.basicConfig(stream=sys.stderr, level=log_level)
if log_level == "DEBUG":
set_debug(True)

MODELS_EMBEDDINGS = {
"llama3.2:3b": 3072
Expand Down Expand Up @@ -132,7 +136,7 @@ def validate_json(obj, file_path):
click.echo(serverless_validation)
click.echo(f"The workflow can compile, result: {valid}")


setup_logging()
cli.add_command(load_data)
cli.add_command(run)
cli.add_command(sample_request)
Expand Down

0 comments on commit 770fdb1

Please sign in to comment.