avalia-se commited on
Commit
602baf4
·
verified ·
1 Parent(s): b46ef64

Upload 9 files

Browse files
Files changed (10) hide show
  1. .gitattributes +1 -0
  2. .gitignore +162 -0
  3. HF_login.txt +1 -0
  4. README.md +1 -12
  5. TABELAS_evo.xlsx +0 -0
  6. __init__.py.txt +5 -0
  7. app.py +96 -0
  8. dados_filtrados.xlsx +0 -0
  9. data_2.xlsx +3 -0
  10. requirements.txt +0 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ data_2.xlsx filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ #.idea/
HF_login.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Ev0f@ct0r
README.md CHANGED
@@ -1,12 +1 @@
1
- ---
2
- title: App
3
- emoji: 📊
4
- colorFrom: red
5
- colorTo: blue
6
- sdk: gradio
7
- sdk_version: 5.23.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ # otimiza
 
 
 
 
 
 
 
 
 
 
 
TABELAS_evo.xlsx ADDED
Binary file (64.8 kB). View file
 
__init__.py.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import numpy as np
3
+ from sklearn.linear_model import LinearRegression
4
+ from sklearn.metrics import r2_score
5
+ from itertools import product
app.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from modules.dados import dados_tab
3
+ from modules.planilha import planilha_tab # Importe apenas planilha_tab, save_new_df é usado internamente no módulo
4
+ from modules.otimiza import otimiza_tab
5
+ from modules.rl import rl_tab
6
+ from modules.ml import ml_tab
7
+ from modules.evo import evo_tab
8
+
9
+ # Cria o app principal
10
+ theme = gr.themes.Citrus(
11
+ primary_hue="gray",
12
+ )
13
+
14
+ # .css para estilizar a interface + JavaScript para ajustar o scroll
15
+ with gr.Blocks(theme=theme, css="""
16
+ @import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;700&display=swap');
17
+
18
+ .small-file-upload {
19
+ height: 65px;
20
+ text-align: center;
21
+ color: black; /* Cor das letras */
22
+ border: 2px solid black !important; /* Borda sólida e larga, !important para sobrepor estilos conflitantes */
23
+ box-sizing: border-box; /* Garante que a borda não afete o tamanho total */
24
+ }
25
+ .small-file-upload span {
26
+ display: none; /* Oculta o texto interno */
27
+ }
28
+ .small-file-upload input[type="file"] {
29
+ color: black; /* Garante que o texto interno fique preto */
30
+ }
31
+ .small-file-upload label {
32
+ color: black; /* Garante que o texto do rótulo fique preto */
33
+ }
34
+ .small span {
35
+ font-size: 1.2em; /* Reduz o tamanho da fonte nos DataFrames */
36
+ white-space: nowrap; /* Impede quebra de linha no cabeçalho */
37
+ width: auto; /* Permite que a largura da coluna cresça conforme o conteúdo */
38
+ display: inline-block; /* Garante que o ajuste de largura funcione corretamente */
39
+ }
40
+ .small span dados {
41
+ font-size: 0.8em; /* Reduz o tamanho da fonte nos DataFrames */
42
+ white-space: nowrap; /* Impede quebra de linha no cabeçalho */
43
+ width: auto; /* Permite que a largura da coluna cresça conforme o conteúdo */
44
+ display: inline-block; /* Garante que o ajuste de largura funcione corretamente */
45
+ }
46
+
47
+ /* Estilo para o título com fonte Quicksand */
48
+ h1 {
49
+ text-align: center;
50
+ font-family: 'Quicksand', sans-serif; /* Aplica a fonte Quicksand */
51
+ font-weight: 700; /* Peso da fonte */
52
+ margin: 20px 0; /* Espaçamento ao redor do título */
53
+ color: black; /* Cor do texto */
54
+ }
55
+ /* Estilo customizado para ajustar a altura do mapa */
56
+ .map-container {
57
+ height: 600px !important;
58
+ margin: 0;
59
+ padding: 0;
60
+ <style>
61
+ }
62
+ """) as app:
63
+ # Adiciona JavaScript para rolar para o topo após ordenar tabelas
64
+ gr.HTML("""
65
+ <script>
66
+ // Função para resetar o scroll ao topo da tabela
67
+ function resetScrollToTop() {
68
+ let tableContainer = document.querySelector(".dataframe-container");
69
+ if (tableContainer) {
70
+ tableContainer.scrollTop = 0; // Voltar ao topo
71
+ }
72
+ }
73
+
74
+ // Monitorar cliques nos cabeçalhos da tabela
75
+ document.addEventListener("click", function(e) {
76
+ if (e.target.closest(".dataframe-container th")) {
77
+ resetScrollToTop();
78
+ }
79
+ });
80
+ </script>
81
+ """)
82
+
83
+ with gr.Tabs():
84
+ # Adiciona abas importadas
85
+ dados_ui, filtered_df_output = dados_tab() ##### MODIFICAÇÃO #####
86
+ planilha_ui, new_df_output = planilha_tab(filtered_df_output) ##### MODIFICAÇÃO ##### # Passa filtered_df_output para a aba Carregar Planilha
87
+ otimiza_ui = otimiza_tab(new_df_output) # Passa new_df_output para a aba Otimizar Modelo
88
+ rl_ui = rl_tab()
89
+ ml_ui = ml_tab(new_df_output) # Passa new_df_output para a aba Machine Learning
90
+ evo_ui = evo_tab()
91
+
92
+ # Executa o app
93
+ if __name__ == "__main__":
94
+ app.launch(share=True)
95
+
96
+
dados_filtrados.xlsx ADDED
Binary file (5.12 kB). View file
 
data_2.xlsx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f18c793a0c089c16ecaf04f8d07c222c2c638f10d4a91bd3bec354f865a0b8fe
3
+ size 1391453
requirements.txt ADDED
Binary file (2.65 kB). View file