Yaron Koresh commited on
Commit
95af88e
·
verified ·
1 Parent(s): f043e56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,7 +3,7 @@ import os
3
  import re
4
  #from tempfile import NamedTemporaryFile
5
  import numpy as np
6
- #import spaces
7
  import random
8
  import string
9
  from diffusers import StableDiffusion3Pipeline
@@ -12,7 +12,7 @@ from pathos.multiprocessing import ProcessingPool as ProcessPoolExecutor
12
  import requests
13
  from lxml.html import fromstring
14
 
15
- pool = ProcessPoolExecutor(100)
16
  pool.__enter__()
17
 
18
  #model_id = "runwayml/stable-diffusion-v1-5"
@@ -58,7 +58,7 @@ def generate_random_string(length):
58
  characters = string.ascii_letters + string.digits
59
  return ''.join(random.choice(characters) for _ in range(length))
60
 
61
- #@spaces.GPU
62
  def Piper(english_prompt):
63
  return pipe(
64
  english_prompt,
 
3
  import re
4
  #from tempfile import NamedTemporaryFile
5
  import numpy as np
6
+ import spaces
7
  import random
8
  import string
9
  from diffusers import StableDiffusion3Pipeline
 
12
  import requests
13
  from lxml.html import fromstring
14
 
15
+ pool = ProcessPoolExecutor(16)
16
  pool.__enter__()
17
 
18
  #model_id = "runwayml/stable-diffusion-v1-5"
 
58
  characters = string.ascii_letters + string.digits
59
  return ''.join(random.choice(characters) for _ in range(length))
60
 
61
+ @spaces.GPU
62
  def Piper(english_prompt):
63
  return pipe(
64
  english_prompt,