Spaces:
Runtime error
Runtime error
IntelligenzaArtificiale
commited on
Commit
·
727081c
1
Parent(s):
a521b51
Update app.py
Browse files
app.py
CHANGED
@@ -88,30 +88,30 @@ st.subheader("Genera codice online ✨")
|
|
88 |
|
89 |
col1, col2, col3 = st.columns([7, 1, 6])
|
90 |
with col1:
|
91 |
-
st.markdown("**
|
92 |
selected_models = st.multiselect(
|
93 |
-
"
|
94 |
GENERATION_MODELS,
|
95 |
default=GENERATION_MODELS,
|
96 |
key=3,
|
97 |
)
|
98 |
st.markdown(" ")
|
99 |
-
st.markdown("**
|
100 |
examples = load_examples()
|
101 |
example_names = [example["name"] for example in examples]
|
102 |
name2id = dict([(name, i) for i, name in enumerate(example_names)])
|
103 |
selected_example = st.selectbox(
|
104 |
-
"
|
105 |
)
|
106 |
example_text = examples[name2id[selected_example]]["value"]
|
107 |
default_length = examples[name2id[selected_example]]["length"]
|
108 |
with col3:
|
109 |
-
st.markdown("**
|
110 |
temperature = st.slider(
|
111 |
"Temperature:", value=0.2, min_value=0.1, step=0.1, max_value=2.0
|
112 |
)
|
113 |
max_new_tokens = st.slider(
|
114 |
-
"
|
115 |
value=default_length,
|
116 |
min_value=8,
|
117 |
step=4,
|
@@ -119,12 +119,12 @@ with col3:
|
|
119 |
)
|
120 |
seed = st.slider("Random seed:", value=42, min_value=0, step=1, max_value=1000)
|
121 |
gen_prompt = st.text_area(
|
122 |
-
"
|
123 |
value=example_text,
|
124 |
height=200,
|
125 |
).strip()
|
126 |
-
if st.button("
|
127 |
-
with st.spinner("
|
128 |
# use threading
|
129 |
generations = []
|
130 |
generate_code_threads(
|
|
|
88 |
|
89 |
col1, col2, col3 = st.columns([7, 1, 6])
|
90 |
with col1:
|
91 |
+
st.markdown("**Modelli disponibli**")
|
92 |
selected_models = st.multiselect(
|
93 |
+
"Seleziona uno o più modelli pe generare del codice:",
|
94 |
GENERATION_MODELS,
|
95 |
default=GENERATION_MODELS,
|
96 |
key=3,
|
97 |
)
|
98 |
st.markdown(" ")
|
99 |
+
st.markdown("**Esempi**")
|
100 |
examples = load_examples()
|
101 |
example_names = [example["name"] for example in examples]
|
102 |
name2id = dict([(name, i) for i, name in enumerate(example_names)])
|
103 |
selected_example = st.selectbox(
|
104 |
+
"Seleziona un esempio per prendere spunto:", example_names
|
105 |
)
|
106 |
example_text = examples[name2id[selected_example]]["value"]
|
107 |
default_length = examples[name2id[selected_example]]["length"]
|
108 |
with col3:
|
109 |
+
st.markdown("**Impostazioni**")
|
110 |
temperature = st.slider(
|
111 |
"Temperature:", value=0.2, min_value=0.1, step=0.1, max_value=2.0
|
112 |
)
|
113 |
max_new_tokens = st.slider(
|
114 |
+
"Token da generare:",
|
115 |
value=default_length,
|
116 |
min_value=8,
|
117 |
step=4,
|
|
|
119 |
)
|
120 |
seed = st.slider("Random seed:", value=42, min_value=0, step=1, max_value=1000)
|
121 |
gen_prompt = st.text_area(
|
122 |
+
"Istruzioni per generare il codice:",
|
123 |
value=example_text,
|
124 |
height=200,
|
125 |
).strip()
|
126 |
+
if st.button("Genera il codice e risparmi tempo", key=4):
|
127 |
+
with st.spinner("Dammi un minuto, sto rubando un programmatore..."):
|
128 |
# use threading
|
129 |
generations = []
|
130 |
generate_code_threads(
|