Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python_open_ai
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
python_open_ai
Commits
f465854a
Commit
f465854a
authored
Apr 10, 2023
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c80ca71b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
ai_pyppeteer.py
+7
-2
dist/ai_pyppeteer.exe
+0
-0
gpt.py
+2
-0
No files found.
ai_pyppeteer.py
View file @
f465854a
...
...
@@ -450,22 +450,26 @@ class ToWork:
def
process_start
(
browser_item
,
lock
):
try
:
logger
.
info
(
'开始执行任务'
)
loop
=
asyncio
.
get_event_loop
()
keyword
=
ToWork
(
browser_item
,
lock
)
logger
.
info
(
'开始执行任务
'
)
logger
.
info
(
'开始执行任务2
'
)
# 生产
loop
.
run_until_complete
(
keyword
.
on_start
())
# 测试
# task = {
# 'policy': 'http://test.phpgpt.com/api/users/config/policy2'
# }
# href = 'https://cdn.discordapp.com/attachments/1090583268467945475/1093734564188409946/suifeng_a_very_cute_boys_16_years_old_fly_a_kitein_beautifulstr_cd2d65d6-ea40-432b-9941-c796504b6082.png'
# loop.run_until_complete(keyword.upload_img(task, href))
except
Exception
as
e
:
logger
.
error
(
e
)
if
__name__
==
'__main__'
:
try
:
logger
.
info
(
'__main__'
)
browser_list
=
[
{
'num'
:
2
,
...
...
@@ -475,6 +479,7 @@ if __name__ == '__main__':
lock
=
Lock
()
l
=
[]
for
item
in
browser_list
:
logger
.
info
(
'任务进程'
)
p
=
Process
(
target
=
process_start
,
args
=
(
item
,
lock
))
p
.
start
()
l
.
append
(
p
)
# 将进程加入列表中,这样 5 个子进程就会全部执行
...
...
dist/ai_pyppeteer.exe
View file @
f465854a
No preview for this file type
gpt.py
View file @
f465854a
import
asyncio
import
json
import
multiprocessing
import
time
import
requests
...
...
@@ -89,6 +90,7 @@ def get_gpt_message(task):
if
__name__
==
'__main__'
:
multiprocessing
.
freeze_support
()
key
=
'laravel_database_gpt_text_prompt'
logger
.
info
(
'开始执行'
)
while
True
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment