Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
import requests
|
|
|
3 |
import streamlit as st
|
4 |
|
5 |
def download_so():
|
@@ -33,10 +34,25 @@ if os.path.exists(output_path):
|
|
33 |
else:
|
34 |
st.write("Failed to download the file.")
|
35 |
|
36 |
-
#
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
|
42 |
|
|
|
1 |
import os
|
2 |
import requests
|
3 |
+
import ctypes
|
4 |
import streamlit as st
|
5 |
|
6 |
def download_so():
|
|
|
34 |
else:
|
35 |
st.write("Failed to download the file.")
|
36 |
|
37 |
+
# Carregar a biblioteca compartilhada usando ctypes
|
38 |
+
lib = ctypes.CDLL(output_path)
|
39 |
+
|
40 |
+
# Definir as funções que serão usadas
|
41 |
+
Initial_Memory = lib.Initial_Memory
|
42 |
+
Synapses_Active = lib.Synapses_Active
|
43 |
+
ExecuteModel = lib.ExecuteModel
|
44 |
+
|
45 |
+
# Tipos de argumentos e retorno das funções
|
46 |
+
Initial_Memory.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p]
|
47 |
+
Initial_Memory.restype = ctypes.c_void_p
|
48 |
+
|
49 |
+
Synapses_Active.argtypes = [ctypes.c_char_p, ctypes.c_void_p]
|
50 |
+
Synapses_Active.restype = ctypes.c_void_p
|
51 |
+
|
52 |
+
ExecuteModel.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int, ctypes.c_char_p, ctypes.c_void_p]
|
53 |
+
ExecuteModel.restype = ctypes.c_char_p
|
54 |
+
|
55 |
+
import keys as key
|
56 |
|
57 |
|
58 |
|