Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ st.markdown(
|
|
45 |
)
|
46 |
df = pd.read_csv("utils/data_preview.csv")
|
47 |
st.dataframe(df)
|
48 |
-
st.
|
49 |
col1, col2= st.columns([1,2])
|
50 |
with col1:
|
51 |
selected_model = st.selectbox(
|
@@ -58,7 +58,7 @@ st.markdown(text)
|
|
58 |
# Model architecture
|
59 |
st.title("2 - Model architecture")
|
60 |
st.markdown("Most code generation models use GPT style architectures trained on code. Some use encoder-decoder architectures such as AlphaCode.")
|
61 |
-
st.
|
62 |
col1, col2= st.columns([1,2])
|
63 |
with col1:
|
64 |
selected_model = st.selectbox(
|
@@ -78,13 +78,13 @@ st.markdown(intro)
|
|
78 |
|
79 |
# Code generation
|
80 |
st.title("4 - Code generation 💻")
|
81 |
-
col1, col2 = st.columns(
|
82 |
with col1:
|
83 |
-
st.
|
84 |
selected_models = st.multiselect(
|
85 |
"Select code generation models to compare", MODELS, default=["CodeParrot"], key=3
|
86 |
)
|
87 |
-
st.
|
88 |
examples = load_examples()
|
89 |
example_names = [example["name"] for example in examples]
|
90 |
name2id = dict([(name, i) for i, name in enumerate(example_names)])
|
@@ -93,8 +93,8 @@ with col1:
|
|
93 |
)
|
94 |
example_text = examples[name2id[selected_example]]["value"]
|
95 |
default_length = examples[name2id[selected_example]]["length"]
|
96 |
-
with
|
97 |
-
st.
|
98 |
temperature = st.slider(
|
99 |
"Temperature:", value=0.2, min_value=0.0, step=0.1, max_value=2.0
|
100 |
)
|
@@ -111,7 +111,7 @@ with col2:
|
|
111 |
gen_prompt = st.text_area(
|
112 |
"Generate code with prompt:",
|
113 |
value=example_text,
|
114 |
-
height=
|
115 |
).strip()
|
116 |
if st.button("Generate code!"):
|
117 |
with st.spinner("Generating code..."):
|
|
|
45 |
)
|
46 |
df = pd.read_csv("utils/data_preview.csv")
|
47 |
st.dataframe(df)
|
48 |
+
st.subheader("Model")
|
49 |
col1, col2= st.columns([1,2])
|
50 |
with col1:
|
51 |
selected_model = st.selectbox(
|
|
|
58 |
# Model architecture
|
59 |
st.title("2 - Model architecture")
|
60 |
st.markdown("Most code generation models use GPT style architectures trained on code. Some use encoder-decoder architectures such as AlphaCode.")
|
61 |
+
st.subheader("Model")
|
62 |
col1, col2= st.columns([1,2])
|
63 |
with col1:
|
64 |
selected_model = st.selectbox(
|
|
|
78 |
|
79 |
# Code generation
|
80 |
st.title("4 - Code generation 💻")
|
81 |
+
col1, col2, col3 = st.columns([5,1,5])
|
82 |
with col1:
|
83 |
+
st.markdown("**Models**")
|
84 |
selected_models = st.multiselect(
|
85 |
"Select code generation models to compare", MODELS, default=["CodeParrot"], key=3
|
86 |
)
|
87 |
+
st.markdown("**Examples**")
|
88 |
examples = load_examples()
|
89 |
example_names = [example["name"] for example in examples]
|
90 |
name2id = dict([(name, i) for i, name in enumerate(example_names)])
|
|
|
93 |
)
|
94 |
example_text = examples[name2id[selected_example]]["value"]
|
95 |
default_length = examples[name2id[selected_example]]["length"]
|
96 |
+
with col3:
|
97 |
+
st.markdown("**Generation settings**")
|
98 |
temperature = st.slider(
|
99 |
"Temperature:", value=0.2, min_value=0.0, step=0.1, max_value=2.0
|
100 |
)
|
|
|
111 |
gen_prompt = st.text_area(
|
112 |
"Generate code with prompt:",
|
113 |
value=example_text,
|
114 |
+
height=150,
|
115 |
).strip()
|
116 |
if st.button("Generate code!"):
|
117 |
with st.spinner("Generating code..."):
|