amarorn commited on
Commit
7179322
·
1 Parent(s): d6c8680

Adicionar app.py e requirements.txt

Browse files
Files changed (2) hide show
  1. app.py +42 -0
  2. requirements.txt +8 -0
app.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ App principal para execução no HuggingFace Space.
4
+ Este arquivo executa o treinamento do modelo EDA.
5
+ """
6
+
7
+ import os
8
+ import subprocess
9
+ import sys
10
+
11
+ def main():
12
+ """
13
+ Executa o script de treinamento.
14
+ """
15
+ print("=" * 60)
16
+ print("Iniciando treinamento do modelo EDA")
17
+ print("=" * 60)
18
+
19
+ script_path = os.path.join(os.path.dirname(__file__), "train.py")
20
+
21
+ if not os.path.exists(script_path):
22
+ print(f"❌ Erro: Arquivo {script_path} não encontrado!")
23
+ sys.exit(1)
24
+
25
+ try:
26
+ result = subprocess.run(
27
+ [sys.executable, script_path],
28
+ check=True,
29
+ capture_output=False,
30
+ )
31
+ print("\n✅ Treinamento concluído com sucesso!")
32
+ return result.returncode
33
+ except subprocess.CalledProcessError as e:
34
+ print(f"\n❌ Erro durante o treinamento: {e}")
35
+ sys.exit(e.returncode)
36
+ except KeyboardInterrupt:
37
+ print("\n⚠️ Treinamento interrompido pelo usuário")
38
+ sys.exit(130)
39
+
40
+ if __name__ == "__main__":
41
+ sys.exit(main())
42
+
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ torch>=2.0.0
2
+ transformers>=4.45.0
3
+ datasets>=2.14.0
4
+ peft>=0.8.0
5
+ accelerate>=0.27.0
6
+ bitsandbytes>=0.41.0
7
+ huggingface_hub>=0.20.0
8
+