Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -32,12 +32,11 @@ from diffusers import DiffusionPipeline, AnimateDiffPipeline, MotionAdapter, Eul
|
|
32 |
#import jax
|
33 |
#import jax.numpy as jnp
|
34 |
from numba import njit as cpu1, jit as cpu2
|
35 |
-
from numba.cuda import
|
36 |
|
37 |
# optimization:
|
38 |
|
39 |
-
# @
|
40 |
-
# @cuda2(cache=True)
|
41 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
42 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
43 |
# @cpu1(cache=True)
|
@@ -127,8 +126,7 @@ function custom(){
|
|
127 |
|
128 |
# functionality
|
129 |
|
130 |
-
@
|
131 |
-
# @cuda2(cache=True)
|
132 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
133 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
134 |
# @cpu1(cache=True)
|
@@ -147,8 +145,7 @@ def run(cmd, assert_success=False, capture_output=False, env=None, dry_run=False
|
|
147 |
|
148 |
return result
|
149 |
|
150 |
-
@
|
151 |
-
# @cuda2(cache=True)
|
152 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
153 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
154 |
# @cpu1(cache=True)
|
@@ -194,8 +191,7 @@ def translate(text,lang):
|
|
194 |
print(ret)
|
195 |
return ret
|
196 |
|
197 |
-
@
|
198 |
-
# @cuda2(cache=True)
|
199 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
200 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
201 |
# @cpu1(cache=True)
|
@@ -204,8 +200,7 @@ def generate_random_string(length):
|
|
204 |
characters = string.ascii_letters + string.digits
|
205 |
return ''.join(random.choice(characters) for _ in range(length))
|
206 |
|
207 |
-
@
|
208 |
-
# @cuda2(cache=True)
|
209 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
210 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
211 |
# @cpu1(cache=True)
|
@@ -247,8 +242,7 @@ def Piper(image,positive,negative,motion):
|
|
247 |
num_frames=(fps*time)
|
248 |
)
|
249 |
|
250 |
-
@
|
251 |
-
# @cuda2(cache=True)
|
252 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
253 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
254 |
# @cpu1(cache=True)
|
@@ -274,8 +268,7 @@ def infer(pm):
|
|
274 |
export_to_gif(out.frames[0],name,fps=fps)
|
275 |
return name
|
276 |
|
277 |
-
@
|
278 |
-
# @cuda2(cache=True)
|
279 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
280 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
281 |
# @cpu1(cache=True)
|
@@ -294,8 +287,7 @@ def handle(i,m,p1,p2,*result):
|
|
294 |
ret.append(infer,pm)
|
295 |
return ret
|
296 |
|
297 |
-
@
|
298 |
-
# @cuda2(cache=True)
|
299 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
300 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
301 |
# @cpu1(cache=True)
|
@@ -353,8 +345,7 @@ def ui():
|
|
353 |
)
|
354 |
demo.queue().launch()
|
355 |
|
356 |
-
@
|
357 |
-
# @cuda2(cache=True)
|
358 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
359 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
360 |
# @cpu1(cache=True)
|
|
|
32 |
#import jax
|
33 |
#import jax.numpy as jnp
|
34 |
from numba import njit as cpu1, jit as cpu2
|
35 |
+
from numba.cuda import jit as cuda
|
36 |
|
37 |
# optimization:
|
38 |
|
39 |
+
# @cuda(cache=True)
|
|
|
40 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
41 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
42 |
# @cpu1(cache=True)
|
|
|
126 |
|
127 |
# functionality
|
128 |
|
129 |
+
@cuda(cache=True)
|
|
|
130 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
131 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
132 |
# @cpu1(cache=True)
|
|
|
145 |
|
146 |
return result
|
147 |
|
148 |
+
@cuda(cache=True)
|
|
|
149 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
150 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
151 |
# @cpu1(cache=True)
|
|
|
191 |
print(ret)
|
192 |
return ret
|
193 |
|
194 |
+
@cuda(cache=True)
|
|
|
195 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
196 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
197 |
# @cpu1(cache=True)
|
|
|
200 |
characters = string.ascii_letters + string.digits
|
201 |
return ''.join(random.choice(characters) for _ in range(length))
|
202 |
|
203 |
+
@cuda(cache=True)
|
|
|
204 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
205 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
206 |
# @cpu1(cache=True)
|
|
|
242 |
num_frames=(fps*time)
|
243 |
)
|
244 |
|
245 |
+
@cuda(cache=True)
|
|
|
246 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
247 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
248 |
# @cpu1(cache=True)
|
|
|
268 |
export_to_gif(out.frames[0],name,fps=fps)
|
269 |
return name
|
270 |
|
271 |
+
@cuda(cache=True)
|
|
|
272 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
273 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
274 |
# @cpu1(cache=True)
|
|
|
287 |
ret.append(infer,pm)
|
288 |
return ret
|
289 |
|
290 |
+
@cuda(cache=True)
|
|
|
291 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
292 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
293 |
# @cpu1(cache=True)
|
|
|
345 |
)
|
346 |
demo.queue().launch()
|
347 |
|
348 |
+
@cuda(cache=True)
|
|
|
349 |
# @cpu1(cache=True,nopython=True,parallel=True)
|
350 |
# @cpu2(cache=True,nopython=True,parallel=True)
|
351 |
# @cpu1(cache=True)
|