Spaces:
Sleeping
Sleeping
epochs-demos
commited on
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -84,11 +84,9 @@ def main():
|
|
84 |
return instructor_function(*params)
|
85 |
|
86 |
# Generate sample examples dynamically by executing the instructor's code
|
87 |
-
sample_examples = "
|
88 |
-
".join(
|
89 |
-
|
90 |
-
params in
|
91 |
-
st.session_state.test_cases])
|
92 |
st.code(sample_examples, language="python")
|
93 |
show_solution_button = st.form_submit_button("Show Solution")
|
94 |
if show_solution_button:
|
|
|
84 |
return instructor_function(*params)
|
85 |
|
86 |
# Generate sample examples dynamically by executing the instructor's code
|
87 |
+
sample_examples = {"
|
88 |
+
".join([f"sum({', '.join(map(str, params))}) -> {execute_instructor_code(params)}"
|
89 |
+
for params in st.session_state.test_cases])}
|
|
|
|
|
90 |
st.code(sample_examples, language="python")
|
91 |
show_solution_button = st.form_submit_button("Show Solution")
|
92 |
if show_solution_button:
|