Update app.py
Browse files
app.py
CHANGED
@@ -393,14 +393,11 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
|
|
393 |
if (prompt.find('Bild zeichnen') != -1):
|
394 |
#print("OpenAI zeichnen.......................")
|
395 |
#llm = ChatOpenAI(model_name = MODEL_NAME_OAI_ZEICHNEN, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
396 |
-
|
397 |
-
data = {'prompt': prompt, 'guidance_scale': scale}
|
398 |
response = requests.post(API_URL, headers=HEADERS, json=data)
|
399 |
-
result = response.
|
400 |
-
|
401 |
-
|
402 |
-
#image = Image.open(io.BytesIO(result))
|
403 |
-
history[-1][1] = image_b64
|
404 |
print("history......................")
|
405 |
print(history)
|
406 |
return history, "Stop: Success"
|
|
|
393 |
if (prompt.find('Bild zeichnen') != -1):
|
394 |
#print("OpenAI zeichnen.......................")
|
395 |
#llm = ChatOpenAI(model_name = MODEL_NAME_OAI_ZEICHNEN, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
396 |
+
data = {"inputs": prompt}
|
|
|
397 |
response = requests.post(API_URL, headers=HEADERS, json=data)
|
398 |
+
result = response.content
|
399 |
+
image = Image.open(io.BytesIO(result))
|
400 |
+
history[-1][1] = file #image
|
|
|
|
|
401 |
print("history......................")
|
402 |
print(history)
|
403 |
return history, "Stop: Success"
|