Spaces:
Runtime error
Runtime error
Pierre Tassel
commited on
Commit
·
01b7d77
1
Parent(s):
c2a60dc
add makespan
Browse files
app.py
CHANGED
@@ -149,7 +149,7 @@ def solve(file):
|
|
149 |
fig.update_yaxes(
|
150 |
autorange=True
|
151 |
)
|
152 |
-
return
|
153 |
|
154 |
ray.init(log_to_driver=False,
|
155 |
ignore_reinit_error=True,
|
@@ -160,12 +160,11 @@ description = "A Job-Shop Scheduling Reinforcement Learning based solver, using
|
|
160 |
"However, due to resource limitations on the HuggingFace platform (a single vCPU available, no GPU), " \
|
161 |
"the results you obtain here don't represent the full potential of the approach. <br>" \
|
162 |
"For large instance, we recommend to run this locally outside the interface as it causes a lot of " \
|
163 |
-
"For large instance, we recommend to run this locally outside the interface as it causes a lot of " \
|
164 |
"overhead. <br>" \
|
165 |
"For fast inference, check out the cached examples below."
|
166 |
|
167 |
article = "<p style='text-align: center'>Article Under Review</p>"
|
168 |
# list all non-hidden files in the 'instances' directory
|
169 |
examples = ['instances/' + f for f in os.listdir('instances') if not f.startswith('.')]
|
170 |
-
iface = gr.Interface(fn=solve, inputs=gr.File(label="Instance File"), outputs=[gr.Text(label="
|
171 |
iface.launch(enable_queue=True)
|
|
|
149 |
fig.update_yaxes(
|
150 |
autorange=True
|
151 |
)
|
152 |
+
return current_solution_cost, str(total_time) + " seconds", pretty_output, fig
|
153 |
|
154 |
ray.init(log_to_driver=False,
|
155 |
ignore_reinit_error=True,
|
|
|
160 |
"However, due to resource limitations on the HuggingFace platform (a single vCPU available, no GPU), " \
|
161 |
"the results you obtain here don't represent the full potential of the approach. <br>" \
|
162 |
"For large instance, we recommend to run this locally outside the interface as it causes a lot of " \
|
|
|
163 |
"overhead. <br>" \
|
164 |
"For fast inference, check out the cached examples below."
|
165 |
|
166 |
article = "<p style='text-align: center'>Article Under Review</p>"
|
167 |
# list all non-hidden files in the 'instances' directory
|
168 |
examples = ['instances/' + f for f in os.listdir('instances') if not f.startswith('.')]
|
169 |
+
iface = gr.Interface(fn=solve, inputs=gr.File(label="Instance File"), outputs=[gr.Text(label="Makespan"), gr.Text(label="Elapsed Time"), gr.Text(label="Solution"), gr.Plot(label="Solution's Gantt Chart")], title=title, description=description, article=article, examples=examples)
|
170 |
iface.launch(enable_queue=True)
|