loubnabnl HF staff commited on
Commit
6b3b52a
1 Parent(s): 99224da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -69,6 +69,22 @@ st.sidebar.markdown(contents)
69
 
70
  # Introduction
71
  st.title("Code generation with 🤗")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  read_markdown("utils/intro.md")
73
 
74
  # Code datasets
@@ -134,7 +150,7 @@ gen_prompt = st.text_area(
134
  value=example_text,
135
  height=200,
136
  ).strip()
137
- if st.button("Generate code!"):
138
  with st.spinner("Generating code..."):
139
  # use threading
140
  generations = []
 
69
 
70
  # Introduction
71
  st.title("Code generation with 🤗")
72
+ read_markdown("utils/summary.md")
73
+ ## teaser
74
+ example_text = "def print_hello_world():"
75
+ col1, col2, col3 = st.columns([1, 2, 1])
76
+ with col2:
77
+ gen_prompt = st.text_area(
78
+ "",
79
+ value=example_text,
80
+ height=100,
81
+ ).strip()
82
+ if st.button("Generate code!", key=1):
83
+ with st.spinner("Generating code..."):
84
+ # use threading
85
+ generations = []
86
+ generate_code(generations, "CodeGen", gen_prompt, 12, 0.2, 42)
87
+ st.code(generations[0])
88
  read_markdown("utils/intro.md")
89
 
90
  # Code datasets
 
150
  value=example_text,
151
  height=200,
152
  ).strip()
153
+ if st.button("Generate code!", key=2):
154
  with st.spinner("Generating code..."):
155
  # use threading
156
  generations = []