Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,12 @@ def generate_code_threads(
|
|
60 |
for t in threads:
|
61 |
t.join()
|
62 |
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
64 |
st.set_page_config(page_icon=":laptop:", layout="wide")
|
65 |
with open("utils/table_contents.md", "r") as f:
|
66 |
contents = f.read()
|
@@ -79,12 +84,11 @@ with col2:
|
|
79 |
value=example_text,
|
80 |
height=100,
|
81 |
).strip()
|
|
|
82 |
if st.button("Generate code!", key=1):
|
83 |
with st.spinner("Generating code..."):
|
84 |
-
|
85 |
-
|
86 |
-
generate_code(generations, "CodeGen", gen_prompt, 10, 0.2, 42)
|
87 |
-
st.code(generations[0])
|
88 |
read_markdown("utils/intro.md")
|
89 |
|
90 |
# Code datasets
|
|
|
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 |
+
st.code(generations[0])
|
68 |
+
|
69 |
st.set_page_config(page_icon=":laptop:", layout="wide")
|
70 |
with open("utils/table_contents.md", "r") as f:
|
71 |
contents = f.read()
|
|
|
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
|