Ahil1991 commited on
Commit
9da0a8d
·
verified ·
1 Parent(s): c2fd0be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -4,24 +4,24 @@ import multiprocessing
4
  # Function to generate numbers
5
  def generate_numbers():
6
  result = []
7
- for number in range(100):
8
  result.append(number)
9
- return result
10
 
11
  # Function to utilize full CPU using multiprocessing
12
  def cpu_intensive_task():
13
  with multiprocessing.Pool() as pool:
14
- pool.map(print, generate_numbers()) # Distribute print task over available CPU cores
15
 
16
- # Create Gradio interface
17
  def gradio_interface():
18
  return generate_numbers()
19
 
20
- # Gradio Interface
21
  demo = gr.Interface(
22
  fn=gradio_interface,
23
- inputs=[],
24
- outputs=gr.outputs.Textbox(),
25
  live=True
26
  )
27
 
 
4
  # Function to generate numbers
5
  def generate_numbers():
6
  result = []
7
+ for number in range(100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000):
8
  result.append(number)
9
+ return "\n".join(map(str, result)) # Return as string for Textbox
10
 
11
  # Function to utilize full CPU using multiprocessing
12
  def cpu_intensive_task():
13
  with multiprocessing.Pool() as pool:
14
+ pool.map(print, range(100)) # Distribute print task over available CPU cores
15
 
16
+ # Gradio Interface
17
  def gradio_interface():
18
  return generate_numbers()
19
 
20
+ # Updated Gradio Interface
21
  demo = gr.Interface(
22
  fn=gradio_interface,
23
+ inputs=None, # No inputs required for this example
24
+ outputs=gr.Textbox(), # Updated output with gr.Textbox()
25
  live=True
26
  )
27