MilesCranmer commited on
Commit
27d64c8
·
unverified ·
1 Parent(s): a9e19e6

Fix up docker

Browse files
Files changed (2) hide show
  1. gui/Dockerfile +3 -1
  2. gui/app.py +13 -13
gui/Dockerfile CHANGED
@@ -23,6 +23,7 @@ COPY ./requirements.txt /code/requirements.txt
23
  RUN useradd -m -u 1000 user
24
  # Switch to the "user" user
25
  USER user
 
26
  # Set home to the user's home directory
27
  ENV HOME=/home/user
28
  ENV PATH=/home/user/.local/bin:$PATH
@@ -34,9 +35,10 @@ RUN /home/user/.venv/bin/python -m pip install --no-cache-dir --upgrade -r /code
34
 
35
  # Install and pre-compile Julia dependencies,
36
  # including the Bumper extension
 
37
  RUN /home/user/.venv/bin/python -c "import pysr; pysr.PySRRegressor(bumper=True, verbosity=0, progress=False, max_evals=1).fit([[1]], [1])"
38
 
39
- WORKDIR $HOME/app
40
  COPY --chown=user . $HOME/app
41
 
42
  EXPOSE 7860
 
23
  RUN useradd -m -u 1000 user
24
  # Switch to the "user" user
25
  USER user
26
+ WORKDIR /home/user/
27
  # Set home to the user's home directory
28
  ENV HOME=/home/user
29
  ENV PATH=/home/user/.local/bin:$PATH
 
35
 
36
  # Install and pre-compile Julia dependencies,
37
  # including the Bumper extension
38
+ RUN /home/user/.venv/bin/python -c "import pysr"
39
  RUN /home/user/.venv/bin/python -c "import pysr; pysr.PySRRegressor(bumper=True, verbosity=0, progress=False, max_evals=1).fit([[1]], [1])"
40
 
41
+ WORKDIR /home/user/app
42
  COPY --chown=user . $HOME/app
43
 
44
  EXPOSE 7860
gui/app.py CHANGED
@@ -107,28 +107,28 @@ def main():
107
  fn=greet,
108
  description="Symbolic Regression with PySR. Watch search progress by clicking 'See logs'!",
109
  inputs=[
110
- gr.inputs.File(label="Upload a CSV File"),
111
- gr.inputs.Textbox(label="Column to Predict", placeholder="y"),
112
- gr.inputs.Slider(
113
  minimum=1,
114
  maximum=1000,
115
- default=40,
116
  label="Number of Iterations",
117
  step=1,
118
  ),
119
- gr.inputs.Slider(
120
  minimum=7,
121
  maximum=35,
122
- default=20,
123
  label="Maximum Complexity",
124
  step=1,
125
  ),
126
- gr.inputs.CheckboxGroup(
127
  choices=["+", "-", "*", "/", "^"],
128
  label="Binary Operators",
129
- default=["+", "-", "*", "/"],
130
  ),
131
- gr.inputs.CheckboxGroup(
132
  choices=[
133
  "sin",
134
  "cos",
@@ -141,16 +141,16 @@ def main():
141
  "tan",
142
  ],
143
  label="Unary Operators",
144
- default=[],
145
  ),
146
- gr.inputs.Checkbox(
147
- default=False,
148
  label="Ignore Warnings",
149
  ),
150
  ],
151
  outputs=[
152
  "dataframe",
153
- gr.outputs.Textbox(label="Error Log"),
154
  ],
155
  )
156
  # Add file to the demo:
 
107
  fn=greet,
108
  description="Symbolic Regression with PySR. Watch search progress by clicking 'See logs'!",
109
  inputs=[
110
+ gr.File(label="Upload a CSV File"),
111
+ gr.Textbox(label="Column to Predict", placeholder="y"),
112
+ gr.Slider(
113
  minimum=1,
114
  maximum=1000,
115
+ value=40,
116
  label="Number of Iterations",
117
  step=1,
118
  ),
119
+ gr.Slider(
120
  minimum=7,
121
  maximum=35,
122
+ value=20,
123
  label="Maximum Complexity",
124
  step=1,
125
  ),
126
+ gr.CheckboxGroup(
127
  choices=["+", "-", "*", "/", "^"],
128
  label="Binary Operators",
129
+ value=["+", "-", "*", "/"],
130
  ),
131
+ gr.CheckboxGroup(
132
  choices=[
133
  "sin",
134
  "cos",
 
141
  "tan",
142
  ],
143
  label="Unary Operators",
144
+ value=[],
145
  ),
146
+ gr.Checkbox(
147
+ value=False,
148
  label="Ignore Warnings",
149
  ),
150
  ],
151
  outputs=[
152
  "dataframe",
153
+ gr.Textbox(label="Error Log"),
154
  ],
155
  )
156
  # Add file to the demo: