main.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # import uvicorn
  2. # if '__main__' == __name__:
  3. # uvicorn.run("service.app:app", host="0.0.0.0", port=1234)
  4. import src.utils.stream as stream
  5. import src.utils as utils
  6. # stream.write_yaml(
  7. # "config.yaml", {
  8. # "model": {},
  9. # "dataset": {},
  10. # "param": {},
  11. # "train": {},
  12. # "test": {}
  13. # }
  14. # )
  15. # data = stream.read_yaml(
  16. # "config.yaml"
  17. # )
  18. # data = {
  19. # "name": "TraningModel",
  20. # "version": "0.0.1",
  21. # "models_dir": "models",
  22. # "datasets_dir": "datasets",
  23. # "interface": {
  24. # "model": {
  25. # "label": {
  26. # "text": ""
  27. # },
  28. # "btn_add_model": {
  29. # "text": "Создать"
  30. # }
  31. # },
  32. # "dataset": {},
  33. # "param": {},
  34. # "train": {},
  35. # "test": {}
  36. # }
  37. # }
  38. # stream.write_yaml("config.yaml", data)
  39. from src.mod import Interface
  40. from src.mod.config import ConfigInterface
  41. from src.mod.model import ModelInterface
  42. from src.mod.dataset import DataSetInterface
  43. from src.mod.test import TestingInterface
  44. from src.mod.train import TraningInterface
  45. from src.mod.params import ParamsInterface
  46. from src.utils.config import Config
  47. from src.utils.params import Params
  48. config = Config.from_file("config.yaml")
  49. interface = Interface(
  50. config=config,
  51. params=Params(
  52. model_path="",
  53. )
  54. )
  55. interface.tabs(
  56. ConfigInterface.from_interface(interface),
  57. ModelInterface.from_interface(interface),
  58. ParamsInterface.from_interface(interface),
  59. DataSetInterface.from_interface(interface),
  60. TraningInterface.from_interface(interface),
  61. TestingInterface.from_interface(interface),
  62. )
  63. print("test")