Update app.py
Browse files
app.py
CHANGED
|
@@ -110,9 +110,11 @@ def upload_and_process(image, promptText, promptImg, lens_option, n_images, size
|
|
| 110 |
# Remove backdrop
|
| 111 |
responses = chatgpt_chain.predict(human_input=promptText)
|
| 112 |
print(responses)
|
|
|
|
|
|
|
| 113 |
#print(type(responses))
|
| 114 |
-
response = json.loads(
|
| 115 |
-
|
| 116 |
dall_e_prompt = promptImg + " , " + lens_option
|
| 117 |
primary = response['primary']
|
| 118 |
headline = response['headline']
|
|
|
|
| 110 |
# Remove backdrop
|
| 111 |
responses = chatgpt_chain.predict(human_input=promptText)
|
| 112 |
print(responses)
|
| 113 |
+
sys.stdout = sys.__stdout__
|
| 114 |
+
clean_output = re.sub(r"\x1b[^m]*m", "", output.getvalue())
|
| 115 |
#print(type(responses))
|
| 116 |
+
response = json.loads(clean_output)
|
| 117 |
+
print(response)
|
| 118 |
dall_e_prompt = promptImg + " , " + lens_option
|
| 119 |
primary = response['primary']
|
| 120 |
headline = response['headline']
|