Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
5a5a76f
1
Parent(s):
c353ada
Turn off multithreading
Browse files- gui/Dockerfile +1 -0
- gui/app.py +12 -1
gui/Dockerfile
CHANGED
@@ -48,4 +48,5 @@ ENV GRADIO_ALLOW_FLAGGING=never \
|
|
48 |
GRADIO_THEME=huggingface \
|
49 |
SYSTEM=spaces
|
50 |
|
|
|
51 |
CMD ["/bin/bash", "-l", "-c", "/home/user/.venv/bin/python /home/user/app/app.py"]
|
|
|
48 |
GRADIO_THEME=huggingface \
|
49 |
SYSTEM=spaces
|
50 |
|
51 |
+
ENV JULIA_NUM_THREADS=1
|
52 |
CMD ["/bin/bash", "-l", "-c", "/home/user/.venv/bin/python /home/user/app/app.py"]
|
gui/app.py
CHANGED
@@ -44,6 +44,7 @@ def greet(
|
|
44 |
maxsize: int,
|
45 |
binary_operators: list,
|
46 |
unary_operators: list,
|
|
|
47 |
force_run: bool,
|
48 |
):
|
49 |
if file_obj is not None:
|
@@ -86,6 +87,10 @@ def greet(
|
|
86 |
binary_operators=binary_operators,
|
87 |
unary_operators=unary_operators,
|
88 |
timeout_in_seconds=1000,
|
|
|
|
|
|
|
|
|
89 |
)
|
90 |
model.fit(X, y)
|
91 |
|
@@ -183,6 +188,10 @@ def _settings_layout():
|
|
183 |
label="Maximum Complexity",
|
184 |
step=1,
|
185 |
)
|
|
|
|
|
|
|
|
|
186 |
force_run = gr.Checkbox(
|
187 |
value=False,
|
188 |
label="Ignore Warnings",
|
@@ -193,6 +202,7 @@ def _settings_layout():
|
|
193 |
niterations=niterations,
|
194 |
maxsize=maxsize,
|
195 |
force_run=force_run,
|
|
|
196 |
)
|
197 |
|
198 |
|
@@ -227,6 +237,7 @@ def main():
|
|
227 |
"maxsize",
|
228 |
"binary_operators",
|
229 |
"unary_operators",
|
|
|
230 |
"force_run",
|
231 |
]
|
232 |
],
|
@@ -242,7 +253,7 @@ def main():
|
|
242 |
for eqn_component in eqn_components:
|
243 |
eqn_component.change(replot, eqn_components, blocks["example_plot"])
|
244 |
|
245 |
-
demo.launch()
|
246 |
|
247 |
|
248 |
def replot(test_equation, num_points, noise_level):
|
|
|
44 |
maxsize: int,
|
45 |
binary_operators: list,
|
46 |
unary_operators: list,
|
47 |
+
seed: int,
|
48 |
force_run: bool,
|
49 |
):
|
50 |
if file_obj is not None:
|
|
|
87 |
binary_operators=binary_operators,
|
88 |
unary_operators=unary_operators,
|
89 |
timeout_in_seconds=1000,
|
90 |
+
multithreading=False,
|
91 |
+
procs=0,
|
92 |
+
deterministic=True,
|
93 |
+
random_state=seed,
|
94 |
)
|
95 |
model.fit(X, y)
|
96 |
|
|
|
188 |
label="Maximum Complexity",
|
189 |
step=1,
|
190 |
)
|
191 |
+
seed = gr.Number(
|
192 |
+
value=0,
|
193 |
+
label="Random Seed",
|
194 |
+
)
|
195 |
force_run = gr.Checkbox(
|
196 |
value=False,
|
197 |
label="Ignore Warnings",
|
|
|
202 |
niterations=niterations,
|
203 |
maxsize=maxsize,
|
204 |
force_run=force_run,
|
205 |
+
seed=seed,
|
206 |
)
|
207 |
|
208 |
|
|
|
237 |
"maxsize",
|
238 |
"binary_operators",
|
239 |
"unary_operators",
|
240 |
+
"seed",
|
241 |
"force_run",
|
242 |
]
|
243 |
],
|
|
|
253 |
for eqn_component in eqn_components:
|
254 |
eqn_component.change(replot, eqn_components, blocks["example_plot"])
|
255 |
|
256 |
+
demo.launch(debug=True)
|
257 |
|
258 |
|
259 |
def replot(test_equation, num_points, noise_level):
|