loubnabnl HF staff commited on
Commit
f5abd01
·
1 Parent(s): 876fb4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -44,7 +44,7 @@ def generate_code(
44
  url=url, json={"data": [gen_prompt, max_new_tokens, temperature, seed]}
45
  )
46
  generated_text = r.json()["data"][0]
47
- generations.append(generated_text)
48
 
49
 
50
  def generate_code_threads(
@@ -199,7 +199,7 @@ if st.button("Generate code!", key=4):
199
  )
200
  for i in range(len(generations)):
201
  st.markdown(f"**{selected_models[i]}**")
202
- st.code(generations[i])
203
  if len(generations) < len(selected_models):
204
  st.markdown("<span style='color:red'>Warning: Some models run into timeout, you can try generating code using the original subspaces: [InCoder](https://huggingface.co/spaces/loubnabnl/incoder-subspace), [CodeGen](https://huggingface.co/spaces/loubnabnl/codegen-subspace), [CodeParrot](https://huggingface.co/spaces/loubnabnl/codeparrot-subspace)</span>", unsafe_allow_html=True)
205
 
 
44
  url=url, json={"data": [gen_prompt, max_new_tokens, temperature, seed]}
45
  )
46
  generated_text = r.json()["data"][0]
47
+ generations.append({model_name: generated_text})
48
 
49
 
50
  def generate_code_threads(
 
199
  )
200
  for i in range(len(generations)):
201
  st.markdown(f"**{selected_models[i]}**")
202
+ st.code(generations[selected_models[i]])
203
  if len(generations) < len(selected_models):
204
  st.markdown("<span style='color:red'>Warning: Some models run into timeout, you can try generating code using the original subspaces: [InCoder](https://huggingface.co/spaces/loubnabnl/incoder-subspace), [CodeGen](https://huggingface.co/spaces/loubnabnl/codegen-subspace), [CodeParrot](https://huggingface.co/spaces/loubnabnl/codeparrot-subspace)</span>", unsafe_allow_html=True)
205