重新排列一下import,添加 ipykernel依赖

This commit is contained in:
严浪
2023-11-15 21:10:39 +08:00
parent 9ca9d31fee
commit 3c3bb4748b
5 changed files with 33 additions and 26 deletions

View File

@@ -1,14 +1,15 @@
import base64
from io import BytesIO
import os
from pprint import pprint
import queue
import re
import time
from io import BytesIO
from pprint import pprint
from subprocess import PIPE
from typing import Dict, Union, Optional, Tuple
from typing import Dict, Optional, Tuple, Union
import jupyter_client
from PIL import Image
import time
IPYKERNEL = os.environ.get('IPYKERNEL', 'chatglm3')

View File

@@ -1,14 +1,15 @@
# 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
import io
import json
import random
import urllib
import uuid
import requests
# NOTE: websocket-client (https://github.com/websocket-client/websocket-client)
import websocket
import uuid
import json
import requests
import urllib
import random
import io
from PIL import Image
@@ -178,7 +179,8 @@ if __name__ == '__main__':
for node_id in images:
for image_data in images[node_id]:
from PIL import Image
import io
from PIL import Image
image = Image.open(io.BytesIO(image_data))
image.show()

View File

@@ -1,18 +1,20 @@
from copy import deepcopy
import inspect
from pprint import pformat
import traceback
from types import GenericAlias
from typing import get_origin, Annotated
import json
import requests
import random
import time
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 zhdate import ZhDate
from datetime import datetime
from chatglm.comfyUI_api import ComfyUIApi
_TOOL_HOOKS = {}
_TOOL_DESCRIPTIONS = {}

View File

@@ -1,17 +1,18 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import datetime
import openai
import json
import os
import random
from chatglm.tool_registry import get_tools, dispatch_tool, extract_code
from chatglm.code_kernel import execute, CodeKernel
from typing import Dict, Union, Optional, Tuple
from datetime import datetime
from typing import Dict, Optional, Tuple, Union
import openai
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()

View File

@@ -12,3 +12,4 @@ websocket
pillow
jupyter_client
zhdate
ipykernel