amirgame197 commited on
Commit
e5af2a3
·
verified ·
1 Parent(s): 426d855

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -5,11 +5,14 @@ import sys
5
  import os
6
 
7
  def download_file(url):
 
 
 
8
  filename = str(random.randint(111111111, 999999999)) + ".png"
9
 
10
  file_path = os.path.join(os.path.dirname(__file__), filename)
11
 
12
- response = requests.get(url)
13
 
14
  if response.status_code == 200:
15
 
@@ -19,8 +22,5 @@ def download_file(url):
19
 
20
  return(file_path)
21
 
22
- def process(prompt):
23
- download_file("https://image.pollinations.ai/prompt/" + prompt + ('.' * random.randint(0, 100)))
24
-
25
  iface = gr.Interface(fn=process, inputs="text", outputs="image")
26
  iface.launch()
 
5
  import os
6
 
7
  def download_file(url):
8
+
9
+
10
+ def process(prompt):
11
  filename = str(random.randint(111111111, 999999999)) + ".png"
12
 
13
  file_path = os.path.join(os.path.dirname(__file__), filename)
14
 
15
+ response = requests.get("https://image.pollinations.ai/prompt/" + prompt + ('.' * random.randint(0, 100)))
16
 
17
  if response.status_code == 200:
18
 
 
22
 
23
  return(file_path)
24
 
 
 
 
25
  iface = gr.Interface(fn=process, inputs="text", outputs="image")
26
  iface.launch()