Skip to content

Commit d3c3745

Browse files
exowandererrti
authored andcommitted
returned to stablelm2 model for testing purposes. PEP8 upgrades in api.py included; logger in api.py functional
1 parent 79934ae commit d3c3745

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ ENV PATH="/usr/local/ollama/bin:${PATH}"
3838

3939

4040
# Pull a language model (see LICENSE_STABLELM2.txt)
41-
ARG MODEL=openchat
41+
# ARG MODEL=openchat
42+
ARG MODEL=stablelm2:1.6b-zephyr
4243
ENV MODEL=${MODEL}
4344
RUN ollama serve & while ! curl http://localhost:11434; do sleep 1; done; ollama pull $MODEL
4445

gswikichat/api.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,29 @@
1212
import logging
1313
import sys
1414

15-
logger = logging.getLogger()
15+
# TODO: Test if this can be added to the `__init__.py` file
16+
# TODO: Add volume to Dockerfile for `gbnc_api.log` file
17+
# Source: https://docs.python.org/3/howto/logging.html
18+
logging.basicConfig(
19+
filename='gbnc_api.log',
20+
encoding='utf-8',
21+
level=logging.DEBUG
22+
)
23+
24+
# Source: https://stackoverflow.com/questions/14058453/
25+
# making-python-loggers-output-all-messages-to-stdout-in-addition-to-log-file
26+
logger = logging.getLogger('gswikicat api')
1627
logger.setLevel(logging.DEBUG)
1728

1829
handler = logging.StreamHandler(sys.stdout)
1930
handler.setLevel(logging.DEBUG)
2031
formatter = logging.Formatter(
21-
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
32+
'%(asctime)s - %(name)s - %(levelname)s - %(message)s'
33+
)
2234
handler.setFormatter(formatter)
2335
logger.addHandler(handler)
36+
# End of logging logger configuration
37+
2438

2539
static_dir = 'frontend/dist'
2640
homepage = f'/{static_dir}'

0 commit comments

Comments
 (0)