重新排列一下import,添加 ipykernel依赖
This commit is contained in:
@@ -1,14 +1,15 @@
|
|||||||
import base64
|
import base64
|
||||||
from io import BytesIO
|
|
||||||
import os
|
import os
|
||||||
from pprint import pprint
|
|
||||||
import queue
|
import queue
|
||||||
import re
|
import re
|
||||||
|
import time
|
||||||
|
from io import BytesIO
|
||||||
|
from pprint import pprint
|
||||||
from subprocess import PIPE
|
from subprocess import PIPE
|
||||||
from typing import Dict, Union, Optional, Tuple
|
from typing import Dict, Optional, Tuple, Union
|
||||||
|
|
||||||
import jupyter_client
|
import jupyter_client
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import time
|
|
||||||
|
|
||||||
IPYKERNEL = os.environ.get('IPYKERNEL', 'chatglm3')
|
IPYKERNEL = os.environ.get('IPYKERNEL', 'chatglm3')
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
# This is an example that uses the websockets api to know when a prompt execution is done
|
# This is an example that uses the websockets api to know when a prompt execution is done
|
||||||
# Once the prompt execution is done it downloads the images using the /history endpoint
|
# Once the prompt execution is done it downloads the images using the /history endpoint
|
||||||
|
|
||||||
|
import io
|
||||||
|
import json
|
||||||
|
import random
|
||||||
|
import urllib
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
import requests
|
||||||
# NOTE: websocket-client (https://github.com/websocket-client/websocket-client)
|
# NOTE: websocket-client (https://github.com/websocket-client/websocket-client)
|
||||||
import websocket
|
import websocket
|
||||||
import uuid
|
|
||||||
import json
|
|
||||||
import requests
|
|
||||||
import urllib
|
|
||||||
import random
|
|
||||||
import io
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
@@ -178,7 +179,8 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
for node_id in images:
|
for node_id in images:
|
||||||
for image_data in images[node_id]:
|
for image_data in images[node_id]:
|
||||||
from PIL import Image
|
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
from PIL import Image
|
||||||
image = Image.open(io.BytesIO(image_data))
|
image = Image.open(io.BytesIO(image_data))
|
||||||
image.show()
|
image.show()
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
from copy import deepcopy
|
|
||||||
import inspect
|
import inspect
|
||||||
from pprint import pformat
|
|
||||||
import traceback
|
|
||||||
from types import GenericAlias
|
|
||||||
from typing import get_origin, Annotated
|
|
||||||
import json
|
import json
|
||||||
import requests
|
|
||||||
import random
|
import random
|
||||||
import time
|
|
||||||
import re
|
import re
|
||||||
from chatglm.comfyUI_api import ComfyUIApi
|
import time
|
||||||
|
import traceback
|
||||||
|
from copy import deepcopy
|
||||||
|
from datetime import datetime
|
||||||
|
from pprint import pformat
|
||||||
|
from types import GenericAlias
|
||||||
|
from typing import Annotated, get_origin
|
||||||
|
|
||||||
|
import requests
|
||||||
from func_news import News
|
from func_news import News
|
||||||
from zhdate import ZhDate
|
from zhdate import ZhDate
|
||||||
from datetime import datetime
|
|
||||||
|
from chatglm.comfyUI_api import ComfyUIApi
|
||||||
|
|
||||||
_TOOL_HOOKS = {}
|
_TOOL_HOOKS = {}
|
||||||
_TOOL_DESCRIPTIONS = {}
|
_TOOL_DESCRIPTIONS = {}
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
#! /usr/bin/env python3
|
#! /usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
import openai
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
from chatglm.tool_registry import get_tools, dispatch_tool, extract_code
|
from datetime import datetime
|
||||||
from chatglm.code_kernel import execute, CodeKernel
|
from typing import Dict, Optional, Tuple, Union
|
||||||
from typing import Dict, Union, Optional, Tuple
|
|
||||||
|
import openai
|
||||||
from wcferry import Wcf
|
from wcferry import Wcf
|
||||||
|
|
||||||
|
from chatglm.code_kernel import CodeKernel, execute
|
||||||
|
from chatglm.tool_registry import dispatch_tool, extract_code, get_tools
|
||||||
|
|
||||||
functions = get_tools()
|
functions = get_tools()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ websocket
|
|||||||
pillow
|
pillow
|
||||||
jupyter_client
|
jupyter_client
|
||||||
zhdate
|
zhdate
|
||||||
|
ipykernel
|
||||||
Reference in New Issue
Block a user