Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f28bcc7

Browse filesBrowse files
authored
Update ChatGPT-with-Stable-Diffusion.ipynb
1 parent 550b6fb commit f28bcc7
Copy full SHA for f28bcc7

File tree

1 file changed

+3
-4
lines changed
Filter options

1 file changed

+3
-4
lines changed

‎ChatGPT-with-Stable-Diffusion.ipynb

Copy file name to clipboardExpand all lines: ChatGPT-with-Stable-Diffusion.ipynb
+3-4
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,10 @@
118118
"pipe = pipe.to(\"cuda\")\n",
119119
"\n",
120120
"# Getting responses using the OpenAI API\n",
121-
"def response_chatgpt(api_key, prompt, negative_prompt):\n",
121+
"def response_chatgpt(api_key, prompt):\n",
122122
" # OPENAI API KEY\n",
123123
" openai.api_key = api_key\n",
124124
" prompt = (f\"I want you to analyze this prompt that is used to generate an image based on it and with a similar structure, I want you to write a prompt but so that it generates images of {prompt}\")\n",
125-
" prompt += f\". But avoid generating images that contain: {negative_prompt}\"\n",
126125
" response = openai.Completion.create(\n",
127126
" engine=\"text-davinci-003\",\n",
128127
" prompt=prompt,\n",
@@ -138,7 +137,7 @@
138137
"# User input\n",
139138
"chatbot = gr.Interface(\n",
140139
" fn=response_chatgpt, \n",
141-
" inputs=[\"text\", \"text\", \"text\"],\n",
140+
" inputs=[\"text\", \"text\"],\n",
142141
" outputs=[\"text\", \"image\"]\n",
143142
")\n",
144143
"chatbot.launch() "
@@ -599,4 +598,4 @@
599598
},
600599
"nbformat": 4,
601600
"nbformat_minor": 0
602-
}
601+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.