Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,36 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
import
|
4 |
-
import
|
5 |
-
import
|
6 |
-
import
|
7 |
-
import
|
8 |
-
import
|
9 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
warnings.filterwarnings("ignore")
|
12 |
root = logging.getLogger()
|
@@ -98,31 +122,6 @@ def run(cmd, assert_success=False, capture_output=False, env=None, dry_run=False
|
|
98 |
|
99 |
return result
|
100 |
|
101 |
-
@njit(cache=True,nopython=True,parallel=True)
|
102 |
-
def deps():
|
103 |
-
try:
|
104 |
-
import spaces
|
105 |
-
import torch
|
106 |
-
import gradio as gr
|
107 |
-
import numpy as np
|
108 |
-
from lxml.html import fromstring
|
109 |
-
#from transformers import pipeline
|
110 |
-
from torch import multiprocessing as mp, nn
|
111 |
-
#from torch.multiprocessing import Pool
|
112 |
-
#from pathos.multiprocessing import ProcessPool as Pool
|
113 |
-
#from pathos.threading import ThreadPool as Pool
|
114 |
-
#from diffusers.pipelines.flux import FluxPipeline
|
115 |
-
from diffusers.utils import export_to_gif, load_image
|
116 |
-
from diffusers.models.modeling_utils import ModelMixin
|
117 |
-
from huggingface_hub import hf_hub_download
|
118 |
-
from safetensors.torch import load_file, save_file
|
119 |
-
from diffusers import DiffusionPipeline, AnimateDiffPipeline, MotionAdapter, EulerDiscreteScheduler, DDIMScheduler, StableDiffusionXLPipeline, UNet2DConditionModel, AutoencoderKL, UNet3DConditionModel
|
120 |
-
#import jax
|
121 |
-
#import jax.numpy as jnp
|
122 |
-
from numba import jit,njit
|
123 |
-
except Exception as e:
|
124 |
-
pass
|
125 |
-
|
126 |
@njit(cache=True,nopython=True,parallel=True)
|
127 |
def translate(text,lang):
|
128 |
if text == None or lang == None:
|
@@ -319,6 +318,5 @@ def pre():
|
|
319 |
|
320 |
mp.set_start_method("spawn", force=True)
|
321 |
|
322 |
-
deps()
|
323 |
pre()
|
324 |
ui()
|
|
|
1 |
+
@njit(cache=True,nopython=True,parallel=True)
|
2 |
+
def deps():
|
3 |
+
import os
|
4 |
+
import subprocess
|
5 |
+
import logging
|
6 |
+
import re
|
7 |
+
import random
|
8 |
+
import string
|
9 |
+
import requests
|
10 |
+
import sys
|
11 |
+
import warnings
|
12 |
+
|
13 |
+
import spaces
|
14 |
+
import torch
|
15 |
+
import gradio as gr
|
16 |
+
import numpy as np
|
17 |
+
from lxml.html import fromstring
|
18 |
+
#from transformers import pipeline
|
19 |
+
from torch import multiprocessing as mp, nn
|
20 |
+
#from torch.multiprocessing import Pool
|
21 |
+
#from pathos.multiprocessing import ProcessPool as Pool
|
22 |
+
#from pathos.threading import ThreadPool as Pool
|
23 |
+
#from diffusers.pipelines.flux import FluxPipeline
|
24 |
+
from diffusers.utils import export_to_gif, load_image
|
25 |
+
from diffusers.models.modeling_utils import ModelMixin
|
26 |
+
from huggingface_hub import hf_hub_download
|
27 |
+
from safetensors.torch import load_file, save_file
|
28 |
+
from diffusers import DiffusionPipeline, AnimateDiffPipeline, MotionAdapter, EulerDiscreteScheduler, DDIMScheduler, StableDiffusionXLPipeline, UNet2DConditionModel, AutoencoderKL, UNet3DConditionModel
|
29 |
+
#import jax
|
30 |
+
#import jax.numpy as jnp
|
31 |
+
from numba import jit,njit
|
32 |
+
|
33 |
+
deps()
|
34 |
|
35 |
warnings.filterwarnings("ignore")
|
36 |
root = logging.getLogger()
|
|
|
122 |
|
123 |
return result
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
@njit(cache=True,nopython=True,parallel=True)
|
126 |
def translate(text,lang):
|
127 |
if text == None or lang == None:
|
|
|
318 |
|
319 |
mp.set_start_method("spawn", force=True)
|
320 |
|
|
|
321 |
pre()
|
322 |
ui()
|