Spaces:
Runtime error
Runtime error
SusiePHaltmann
commited on
Commit
•
15004c6
1
Parent(s):
6c65253
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ st.text("To use this app, simply enter the desired text prompt and hit generate.
|
|
22 |
|
23 |
@st.cache(allow_output_mutation=True) # This decorator ensures that the function only runs once per session. Otherwise, each time we generate a prompt, it would run again! This is important because we don't want to keep re-generating prompts unnecessarily. We only want to generate a new prompt when the user enters a new one. If we didn't cache this function, each time we generated a new prompt, it would also regenerate all of the previous prompts! Caching is an important concept in Streamlit apps - it can help make your apps much more efficient by avoiding unnecessary computations.
|
24 |
|
25 |
-
|
26 |
|
27 |
return "Enter text here" + text + "and hit generate!"
|
28 |
|
|
|
22 |
|
23 |
@st.cache(allow_output_mutation=True) # This decorator ensures that the function only runs once per session. Otherwise, each time we generate a prompt, it would run again! This is important because we don't want to keep re-generating prompts unnecessarily. We only want to generate a new prompt when the user enters a new one. If we didn't cache this function, each time we generated a new prompt, it would also regenerate all of the previous prompts! Caching is an important concept in Streamlit apps - it can help make your apps much more efficient by avoiding unnecessary computations.
|
24 |
|
25 |
+
def generate_prompt(text): # This is the function that actually generates our VQ-GAN prompt It takes in a string (the text prompt) and outputs another string (the generated VQ-GAN prompt). We'll use this function to actually generate our VQ-GAN prompts when the user hits "Generate".
|
26 |
|
27 |
return "Enter text here" + text + "and hit generate!"
|
28 |
|