Manul, da commited on
Commit
f47174e
·
1 Parent(s): 8419ac2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -2,7 +2,15 @@ import gradio as gr
2
  import net
3
  import start
4
 
5
- def classify(text): return str(start.clf(text))
 
 
6
 
7
- iface = gr.Interface(fn=classify, inputs="text", outputs="text")
8
- iface.launch()
 
 
 
 
 
 
 
2
  import net
3
  import start
4
 
5
+ def binary_to_int(binary_array):
6
+ # Reverse the array to start from the least significant bit
7
+ binary_array = np.flip(binary_array)
8
 
9
+ # Initialize the result
10
+ result = 0
11
+
12
+ # Iterate over the array and calculate the decimal value
13
+ for i, bit in enumerate(binary_array):
14
+ result += bit * (2 ** i)
15
+
16
+ return result