Your Name commited on
Commit
79914bb
1 Parent(s): c22b4c3

fix dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -5
  2. main.py +3 -1
Dockerfile CHANGED
@@ -1,8 +1,4 @@
1
- FROM ubuntu:latest
2
-
3
- RUN apt-get update && \
4
- apt-get install -y python3 python3-pip && \
5
- rm -rf /var/lib/apt/lists/*
6
 
7
  RUN echo '[global]' > /etc/pip.conf && \
8
  echo 'index-url = https://mirrors.aliyun.com/pypi/simple/' >> /etc/pip.conf && \
 
1
+ FROM python:3.11
 
 
 
 
2
 
3
  RUN echo '[global]' > /etc/pip.conf && \
4
  echo 'index-url = https://mirrors.aliyun.com/pypi/simple/' >> /etc/pip.conf && \
main.py CHANGED
@@ -13,9 +13,11 @@ PORT = find_free_port() if WEB_PORT <= 0 else WEB_PORT
13
  initial_prompt = "Serve me as a writing and programming assistant."
14
  title_html = """<h1 align="center">ChatGPT 学术优化</h1>"""
15
 
 
16
  import logging
17
  os.makedirs('gpt_log', exist_ok=True)
18
- logging.basicConfig(filename='gpt_log/chat_secrets.log', level=logging.INFO, encoding='utf-8') # python 版本建议3.9+(越新越好)
 
19
  print('所有问询记录将自动保存在本地目录./gpt_log/chat_secrets.log,请注意自我隐私保护哦!')
20
 
21
  # 一些普通功能模块
 
13
  initial_prompt = "Serve me as a writing and programming assistant."
14
  title_html = """<h1 align="center">ChatGPT 学术优化</h1>"""
15
 
16
+ # 问询记录,python 版本建议3.9+(越新越好)
17
  import logging
18
  os.makedirs('gpt_log', exist_ok=True)
19
+ try:logging.basicConfig(filename='gpt_log/chat_secrets.log', level=logging.INFO, encoding='utf-8')
20
+ except:logging.basicConfig(filename='gpt_log/chat_secrets.log', level=logging.INFO)
21
  print('所有问询记录将自动保存在本地目录./gpt_log/chat_secrets.log,请注意自我隐私保护哦!')
22
 
23
  # 一些普通功能模块