This commit is contained in:
parent
9288855edd
commit
c2c6071c14
|
@ -18,7 +18,7 @@ import random
|
||||||
import sys
|
import sys
|
||||||
import time,re
|
import time,re
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
import jdspider
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import jieba # just for linting
|
import jieba # just for linting
|
||||||
|
@ -27,7 +27,7 @@ try:
|
||||||
#import yaml
|
#import yaml
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
import zhon.hanzi
|
import zhon.hanzi
|
||||||
import openai
|
|
||||||
except:
|
except:
|
||||||
print('解决依赖问题...稍等')
|
print('解决依赖问题...稍等')
|
||||||
os.system('pip3 install lxml &> /dev/null')
|
os.system('pip3 install lxml &> /dev/null')
|
||||||
|
@ -42,8 +42,13 @@ except:
|
||||||
import requests
|
import requests
|
||||||
import openai
|
import openai
|
||||||
|
|
||||||
import jdspider
|
if "OPENAI_API_KEY" in os.environ:
|
||||||
|
print('已启用AI评价');
|
||||||
|
try:
|
||||||
|
import openai
|
||||||
|
except:
|
||||||
|
print('安装openai模块')
|
||||||
|
os.system('pip3 install openai &> /dev/null')
|
||||||
|
|
||||||
# constants
|
# constants
|
||||||
CONFIG_PATH = './config.yml'
|
CONFIG_PATH = './config.yml'
|
||||||
|
|
Loading…
Reference in New Issue