Update app.py
Browse files
app.py
CHANGED
@@ -60,11 +60,11 @@ def generate_code_threads(
|
|
60 |
for t in threads:
|
61 |
t.join()
|
62 |
|
63 |
-
@st.cache()
|
64 |
def generate_teaser(gen_prompt):
|
65 |
generations = []
|
66 |
generate_code(generations, "CodeGen", gen_prompt, 10, 0.2, 42)
|
67 |
-
|
68 |
|
69 |
st.set_page_config(page_icon=":laptop:", layout="wide")
|
70 |
with open("utils/table_contents.md", "r") as f:
|
@@ -84,11 +84,9 @@ with col2:
|
|
84 |
value=example_text,
|
85 |
height=100,
|
86 |
).strip()
|
87 |
-
|
88 |
if st.button("Generate code!", key=1):
|
89 |
with st.spinner("Generating code..."):
|
90 |
-
generate_teaser(gen_prompt)
|
91 |
-
|
92 |
read_markdown("utils/intro.md")
|
93 |
|
94 |
# Code datasets
|
|
|
60 |
for t in threads:
|
61 |
t.join()
|
62 |
|
63 |
+
@st.cache(show_spinner=False)
|
64 |
def generate_teaser(gen_prompt):
|
65 |
generations = []
|
66 |
generate_code(generations, "CodeGen", gen_prompt, 10, 0.2, 42)
|
67 |
+
return generations[0]
|
68 |
|
69 |
st.set_page_config(page_icon=":laptop:", layout="wide")
|
70 |
with open("utils/table_contents.md", "r") as f:
|
|
|
84 |
value=example_text,
|
85 |
height=100,
|
86 |
).strip()
|
|
|
87 |
if st.button("Generate code!", key=1):
|
88 |
with st.spinner("Generating code..."):
|
89 |
+
st.code(generate_teaser(gen_prompt))
|
|
|
90 |
read_markdown("utils/intro.md")
|
91 |
|
92 |
# Code datasets
|