Spaces:
Runtime error
Runtime error
Pierre Tassel
commited on
Commit
·
dfe9f8e
1
Parent(s):
e5ff636
cleanup
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import collections
|
2 |
import datetime
|
3 |
import os
|
4 |
import random
|
@@ -9,7 +8,7 @@ import json
|
|
9 |
|
10 |
import pandas as pd
|
11 |
import ray
|
12 |
-
|
13 |
from compiled_jss.CPEnv import CompiledJssEnvCP
|
14 |
|
15 |
from stable_baselines3.common.vec_env import VecEnvWrapper
|
@@ -21,8 +20,6 @@ import numpy as np
|
|
21 |
from MyVecEnv import WrapperRay
|
22 |
|
23 |
import gradio as gr
|
24 |
-
import docplex.cp.utils_visu as visu
|
25 |
-
import matplotlib.pyplot as plt
|
26 |
|
27 |
|
28 |
class VecPyTorch(VecEnvWrapper):
|
@@ -155,17 +152,21 @@ ray.init(log_to_driver=False,
|
|
155 |
ignore_reinit_error=True,
|
156 |
include_dashboard=False)
|
157 |
title = "Job-Shop Scheduling CP RL"
|
158 |
-
description = "A Job-Shop Scheduling Reinforcement Learning based solver
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
"overhead. <br>" \
|
164 |
-
"For fast inference, check out the cached examples below. <br>" \
|
165 |
-
"Any Job-Shop Scheduling instance following the standard specification is compatible, <a href='http://jobshop.jjvh.nl/index.php'>checkout this website for more instances</a>." \
|
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,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
iface.launch(enable_queue=True)
|
|
|
|
|
1 |
import datetime
|
2 |
import os
|
3 |
import random
|
|
|
8 |
|
9 |
import pandas as pd
|
10 |
import ray
|
11 |
+
|
12 |
from compiled_jss.CPEnv import CompiledJssEnvCP
|
13 |
|
14 |
from stable_baselines3.common.vec_env import VecEnvWrapper
|
|
|
20 |
from MyVecEnv import WrapperRay
|
21 |
|
22 |
import gradio as gr
|
|
|
|
|
23 |
|
24 |
|
25 |
class VecPyTorch(VecEnvWrapper):
|
|
|
152 |
ignore_reinit_error=True,
|
153 |
include_dashboard=False)
|
154 |
title = "Job-Shop Scheduling CP RL"
|
155 |
+
description = """A Job-Shop Scheduling Reinforcement Learning based solver using an underlying CP model as an environment. <br>
|
156 |
+
However, the results you obtain here don't represent the full potential of the approach due to resource limitations on the HuggingFace platform (a single vCPU available, no GPU).<br>
|
157 |
+
We recommend running this locally outside the interface for large instances, as it causes a lot of overhead.<br>
|
158 |
+
For fast inference, check out the cached examples below.<br>
|
159 |
+
Any Job-Shop Scheduling instance following the standard specification is compatible. <a href='http://jobshop.jjvh.nl/index.php'>Check out this website for more instances</a>."""
|
|
|
|
|
|
|
160 |
|
161 |
article = "<p style='text-align: center'>Article Under Review</p>"
|
162 |
# list all non-hidden files in the 'instances' directory
|
163 |
examples = ['instances/' + f for f in os.listdir('instances') if not f.startswith('.')]
|
164 |
+
iface = gr.Interface(fn=solve,
|
165 |
+
inputs=gr.File(label="Instance File"),
|
166 |
+
outputs=[gr.Text(label="Makespan"), gr.Text(label="Elapsed Time"), gr.Text(label="Solution"), gr.Plot(label="Solution's Gantt Chart")],
|
167 |
+
title=title,
|
168 |
+
description=description,
|
169 |
+
article=article,
|
170 |
+
examples=examples,
|
171 |
+
allow_flagging="never")
|
172 |
iface.launch(enable_queue=True)
|