Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ from langchain.chains import LLMChain
|
|
4 |
from langchain.llms import HuggingFaceHub
|
5 |
from langchain.prompts import PromptTemplate
|
6 |
import requests
|
|
|
7 |
import streamlit as st
|
8 |
import json
|
9 |
|
@@ -75,6 +76,7 @@ def generate_image(topic):
|
|
75 |
# You can access the image with PIL.Image for example
|
76 |
|
77 |
image = Image.open(io.BytesIO(image_bytes))
|
|
|
78 |
return image
|
79 |
|
80 |
# Streamlit app
|
|
|
4 |
from langchain.llms import HuggingFaceHub
|
5 |
from langchain.prompts import PromptTemplate
|
6 |
import requests
|
7 |
+
import base64
|
8 |
import streamlit as st
|
9 |
import json
|
10 |
|
|
|
76 |
# You can access the image with PIL.Image for example
|
77 |
|
78 |
image = Image.open(io.BytesIO(image_bytes))
|
79 |
+
image.save(f"{topic}.png")
|
80 |
return image
|
81 |
|
82 |
# Streamlit app
|