Update app.py
Browse files
app.py
CHANGED
@@ -26,16 +26,16 @@ weigths_file = download(url_weights, save_destination)
|
|
26 |
#--------------------------------
|
27 |
# setup
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
is_gpu_busy = False
|
30 |
def get_correct_qcs_image(srv, num_of_qubits, max_gates, g):
|
31 |
global is_gpu_busy
|
32 |
-
|
33 |
-
try:
|
34 |
-
pipeline
|
35 |
-
except:
|
36 |
-
pipeline = DiffusionPipeline.from_config_file(save_destination, infer_torch_device())
|
37 |
-
pipeline.scheduler.set_timesteps(20)
|
38 |
-
|
39 |
out_tensor = generate_srv_tensors(pipeline, f"Generate SRV: {srv}", samples=6, system_size=num_of_qubits, num_of_qubits=num_of_qubits, max_gates=max_gates, g=g)
|
40 |
qc_list, _, svr_list = convert_tensors_to_srvs(out_tensor, pipeline.gate_pool)
|
41 |
|
|
|
26 |
#--------------------------------
|
27 |
# setup
|
28 |
|
29 |
+
try:
|
30 |
+
pipeline
|
31 |
+
except:
|
32 |
+
pipeline = DiffusionPipeline.from_config_file(save_destination, infer_torch_device())
|
33 |
+
pipeline.scheduler.set_timesteps(20)
|
34 |
+
|
35 |
is_gpu_busy = False
|
36 |
def get_correct_qcs_image(srv, num_of_qubits, max_gates, g):
|
37 |
global is_gpu_busy
|
38 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
out_tensor = generate_srv_tensors(pipeline, f"Generate SRV: {srv}", samples=6, system_size=num_of_qubits, num_of_qubits=num_of_qubits, max_gates=max_gates, g=g)
|
40 |
qc_list, _, svr_list = convert_tensors_to_srvs(out_tensor, pipeline.gate_pool)
|
41 |
|