rubend18 commited on
Commit
0a8c97b
·
1 Parent(s): 510f51f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -14,18 +14,18 @@ def entropy(X):
14
  return en
15
 
16
  def string_to_list(string):
17
- # Divide la cadena en una lista de subcadenas separadas por comas
18
  substrings = string.split(',')
19
 
20
- # Convierte cada subcadena en un número entero y agrega a una lista
21
  response = substrings
22
  return response
23
 
24
  def function(valores):
25
  return entropy(string_to_list(valores))
26
 
27
- value1 = gr.Textbox(lines=3, label="Valores", placeholder="Ingrese los valores separados por comas...")
28
- value2 = gr.Textbox(lines=3, label="Resultado", placeholder="Resultado...")
29
 
30
  examples = [
31
  ["1,2,3,4,5,6,7,8,9"],
@@ -39,9 +39,9 @@ demo = gr.Interface(
39
  fn=function,
40
  inputs=value1,
41
  outputs=value2,
42
- title="Calcular entropía",
43
  examples=examples,
44
- description="Calcula la entropía de un conjunto de números"
45
  )
46
 
47
  demo.launch(debug=True)
 
14
  return en
15
 
16
  def string_to_list(string):
17
+ # Divide the string into a list of substrings separated by commas
18
  substrings = string.split(',')
19
 
20
+ # Convert each substring to an integer and add to a list
21
  response = substrings
22
  return response
23
 
24
  def function(valores):
25
  return entropy(string_to_list(valores))
26
 
27
+ value1 = gr.Textbox(lines=3, label="Values", placeholder="Please enter the values separated by commas...")
28
+ value2 = gr.Textbox(lines=3, label="Result", placeholder="Result...")
29
 
30
  examples = [
31
  ["1,2,3,4,5,6,7,8,9"],
 
39
  fn=function,
40
  inputs=value1,
41
  outputs=value2,
42
+ title="Entropy calculator",
43
  examples=examples,
44
+ description="Calculate the entropy of a set of numbers."
45
  )
46
 
47
  demo.launch(debug=True)