Update app.py
Browse files
app.py
CHANGED
@@ -12,12 +12,20 @@ def entropy(X):
|
|
12 |
|
13 |
return en
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
|
17 |
import gradio as gr
|
18 |
|
19 |
def function(valores):
|
20 |
-
return entropy(valores)
|
21 |
|
22 |
demo = gr.Interface(
|
23 |
fn=function,
|
|
|
12 |
|
13 |
return en
|
14 |
|
15 |
+
def string_to_list(string):
|
16 |
+
# Divide la cadena en una lista de subcadenas separadas por comas
|
17 |
+
substrings = string.split(',')
|
18 |
+
|
19 |
+
# Convierte cada subcadena en un número entero y agrega a una lista
|
20 |
+
response = list(map(int, substrings))
|
21 |
+
return response
|
22 |
+
|
23 |
|
24 |
|
25 |
import gradio as gr
|
26 |
|
27 |
def function(valores):
|
28 |
+
return entropy(string_to_list(valores))
|
29 |
|
30 |
demo = gr.Interface(
|
31 |
fn=function,
|