loubnabnl HF staff commited on
Commit
f4313df
β€’
1 Parent(s): b2b3b37

update app

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -17,13 +17,12 @@ def load_model(model_ckpt):
17
 
18
  @st.cache()
19
  def load_examples():
20
- with open("examples.json", "r") as f:
21
  examples = json.load(f)
22
  return examples
23
 
24
  st.set_page_config(page_icon=":laptop:", layout="wide")
25
 
26
-
27
  st.sidebar.header("Models")
28
  models = ["CodeParrot", "InCoder"]
29
  selected_models = st.sidebar.multiselect("Select code generation models to compare", models, default=["CodeParrot"])
@@ -35,14 +34,14 @@ selected_task = st.sidebar.selectbox("Select a task", tasks)
35
 
36
  if selected_task == " ":
37
  st.title("Code Generation Models")
38
- with open("intro.txt", "r") as f:
39
  intro = f.read()
40
  st.markdown(intro)
41
 
42
  elif selected_task == "Pretraining datasets":
43
  st.title("Pretraining datasets πŸ“š")
44
  st.markdown("Preview of some code files from Github repositories")
45
- df = pd.read_csv("data_preview.csv")
46
  st.dataframe(df)
47
  for model in selected_models:
48
  with open(f"datasets/{model.lower()}.txt", "r") as f:
@@ -72,7 +71,7 @@ elif selected_task == "Code generation":
72
  examples = load_examples()
73
  example_names = [example["name"] for example in examples]
74
  name2id = dict([(name, i) for i, name in enumerate(example_names)])
75
- selected_example = st.sidebar.selectbox("Select one of the following examples", example_names)
76
  example_text = examples[name2id[selected_example]]["value"]
77
  default_length = examples[name2id[selected_example]]["length"]
78
  st.sidebar.header("Generation settings")
 
17
 
18
  @st.cache()
19
  def load_examples():
20
+ with open("utils/examples.json", "r") as f:
21
  examples = json.load(f)
22
  return examples
23
 
24
  st.set_page_config(page_icon=":laptop:", layout="wide")
25
 
 
26
  st.sidebar.header("Models")
27
  models = ["CodeParrot", "InCoder"]
28
  selected_models = st.sidebar.multiselect("Select code generation models to compare", models, default=["CodeParrot"])
 
34
 
35
  if selected_task == " ":
36
  st.title("Code Generation Models")
37
+ with open("utils/intro.txt", "r") as f:
38
  intro = f.read()
39
  st.markdown(intro)
40
 
41
  elif selected_task == "Pretraining datasets":
42
  st.title("Pretraining datasets πŸ“š")
43
  st.markdown("Preview of some code files from Github repositories")
44
+ df = pd.read_csv("utils/data_preview.csv")
45
  st.dataframe(df)
46
  for model in selected_models:
47
  with open(f"datasets/{model.lower()}.txt", "r") as f:
 
71
  examples = load_examples()
72
  example_names = [example["name"] for example in examples]
73
  name2id = dict([(name, i) for i, name in enumerate(example_names)])
74
+ selected_example = st.sidebar.selectbox("Select one of the following examples or implement yours", example_names)
75
  example_text = examples[name2id[selected_example]]["value"]
76
  default_length = examples[name2id[selected_example]]["length"]
77
  st.sidebar.header("Generation settings")