LanHarmony commited on
Commit
44a18ef
1 Parent(s): 80c33e5

introduce control net

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -1,5 +1,3 @@
1
- import os
2
-
3
  VISUAL_CHATGPT_PREFIX = """Visual ChatGPT is designed to be able to assist with a wide range of text and visual related tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. Visual ChatGPT is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.
4
 
5
  Visual ChatGPT is able to process and understand large amounts of text and image. As a language model, Visual ChatGPT can not directly read images, but it has a list of tools to finish different visual tasks. Each image will have a file name formed as "image/xxx.png", and Visual ChatGPT can invoke different tools to indirectly understand pictures. When talking about images, Visual ChatGPT is very strict to the file name and will never fabricate nonexistent files. When using tools to generate new image files, Visual ChatGPT is also known that the image may not be the same as user's demand, and will use other visual question answering tools or description tools to observe the real image. Visual ChatGPT is able to use tools in a sequence, and is loyal to the tool observation outputs rather than faking the image content and image file name. It will remember to provide the file name from the last tool observation, if a new image is generated.
@@ -53,12 +51,7 @@ def execute_cmd(cmd):
53
  execute_cmd('ln -s ControlNet/ldm ./ldm')
54
  execute_cmd('ln -s ControlNet/cldm ./cldm')
55
  execute_cmd('ln -s ControlNet/annotator ./annotator')
56
-
57
- # prepare the folder to store images
58
- try:
59
- os.mkdir('./image')
60
- except OSError as error:
61
- print(error)
62
 
63
  from diffusers import StableDiffusionPipeline
64
  from diffusers import StableDiffusionInpaintPipeline
@@ -74,6 +67,10 @@ from langchain.vectorstores import Weaviate
74
  import re
75
  import gradio as gr
76
 
 
 
 
 
77
 
78
  def cut_dialogue_history(history_memory, keep_last_n_words=500):
79
  tokens = history_memory.split()
 
 
 
1
  VISUAL_CHATGPT_PREFIX = """Visual ChatGPT is designed to be able to assist with a wide range of text and visual related tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. Visual ChatGPT is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.
2
 
3
  Visual ChatGPT is able to process and understand large amounts of text and image. As a language model, Visual ChatGPT can not directly read images, but it has a list of tools to finish different visual tasks. Each image will have a file name formed as "image/xxx.png", and Visual ChatGPT can invoke different tools to indirectly understand pictures. When talking about images, Visual ChatGPT is very strict to the file name and will never fabricate nonexistent files. When using tools to generate new image files, Visual ChatGPT is also known that the image may not be the same as user's demand, and will use other visual question answering tools or description tools to observe the real image. Visual ChatGPT is able to use tools in a sequence, and is loyal to the tool observation outputs rather than faking the image content and image file name. It will remember to provide the file name from the last tool observation, if a new image is generated.
 
51
  execute_cmd('ln -s ControlNet/ldm ./ldm')
52
  execute_cmd('ln -s ControlNet/cldm ./cldm')
53
  execute_cmd('ln -s ControlNet/annotator ./annotator')
54
+ print(execute_cmd('nvidia-smi'))
 
 
 
 
 
55
 
56
  from diffusers import StableDiffusionPipeline
57
  from diffusers import StableDiffusionInpaintPipeline
 
67
  import re
68
  import gradio as gr
69
 
70
+ try:
71
+ os.mkdir('./image')
72
+ except OSError as error:
73
+ print(error)
74
 
75
  def cut_dialogue_history(history_memory, keep_last_n_words=500):
76
  tokens = history_memory.split()