Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
#from tempfile import NamedTemporaryFile
|
3 |
import numpy as np
|
|
|
4 |
import random
|
5 |
import string
|
6 |
from diffusers import StableDiffusionPipeline as DiffusionPipeline
|
@@ -60,6 +61,7 @@ def generate_random_string(length):
|
|
60 |
characters = string.ascii_letters + string.digits
|
61 |
return ''.join(random.choice(characters) for _ in range(length))
|
62 |
|
|
|
63 |
def infer(prompt):
|
64 |
name = generate_random_string(12)+".png"
|
65 |
english_prompt = translate(prompt,"en")
|
|
|
1 |
import gradio as gr
|
2 |
#from tempfile import NamedTemporaryFile
|
3 |
import numpy as np
|
4 |
+
import spaces
|
5 |
import random
|
6 |
import string
|
7 |
from diffusers import StableDiffusionPipeline as DiffusionPipeline
|
|
|
61 |
characters = string.ascii_letters + string.digits
|
62 |
return ''.join(random.choice(characters) for _ in range(length))
|
63 |
|
64 |
+
@spaces.GPU
|
65 |
def infer(prompt):
|
66 |
name = generate_random_string(12)+".png"
|
67 |
english_prompt = translate(prompt,"en")
|