Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Makefile 3.4 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
  1. .PHONY: clean dirs virtualenv lint requirements push pull run clone upload
  2. #################################################################################
  3. # GLOBALS #
  4. #################################################################################
  5. PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
  6. PYTHON_INTERPRETER = python
  7. #################################################################################
  8. # COMMANDS #
  9. #################################################################################
  10. ## Create virtualenv.
  11. ## Activate with the command:
  12. ## source env/bin/activate
  13. virtualenv:
  14. virtualenv -p $(PYTHON_INTERPRETER) env
  15. ## Install Python Dependencies.
  16. ## Make sure you activate the virtualenv first!
  17. requirements:
  18. $(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
  19. $(PYTHON_INTERPRETER) -m pip install -r requirements.txt
  20. ## Create directories that are ignored by git but required for the project
  21. dirs:
  22. mkdir -p data/raw data/processed models
  23. ## Delete all compiled Python files
  24. clean:
  25. find . -type f -name "*.py[co]" -delete
  26. find . -type d -name "__pycache__" -delete
  27. ## Lint using flake8
  28. lint:
  29. flake8 src
  30. black src
  31. ## Upload Data to default DVC remote
  32. push:
  33. dvc push -r origin
  34. ## Download Data from default DVC remote
  35. pull:
  36. dvc pull -r origin
  37. ## run the DVC pipeline - recompute any modified outputs such as processed data or trained models
  38. run:
  39. dvc repro eval
  40. ## run the visualization using Streamlit
  41. visualize:
  42. dvc repro visualize
  43. ## push the trained model to HF model hub
  44. upload:
  45. dvc repro push_to_hf_hub
  46. ## Clone the T5 summarisation repo
  47. clone:
  48. git clone https://dagshub.com/gagan3012/summarization.git
  49. ## Update python package
  50. update:
  51. python setup.py sdist bdist_wheel
  52. python -m twine upload dist/*
  53. #################################################################################
  54. # PROJECT RULES #
  55. #################################################################################
  56. #################################################################################
  57. # Self Documenting Commands #
  58. #################################################################################
  59. .DEFAULT_GOAL := help
  60. # Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
  61. # sed script explained:
  62. # /^##/:
  63. # * save line in hold space
  64. # * purge line
  65. # * Loop:
  66. # * append newline + line to hold space
  67. # * go to next line
  68. # * if line starts with doc comment, strip comment character off and loop
  69. # * remove target prerequisites
  70. # * append hold space (+ newline) to line
  71. # * replace newline plus comments by `---`
  72. # * print line
  73. # Separate expressions are necessary because labels cannot be delimited by
  74. # semicolon; see <http://stackoverflow.com/a/11799865/1968>
  75. .PHONY: help
  76. help:
  77. @echo "$$(tput bold)Available rules:$$(tput sgr0)"
  78. @echo
  79. @sed -n -e "/^## / Missing" $Missing \
  80. | LC_ALL='C' sort --ignore-case \
  81. | awk -F '---' \
  82. -v ncol=$$(tput cols) \
  83. -v indent=19 \
  84. -v col_on="$$(tput setaf 6)" \
  85. -v col_off="$$(tput sgr0)" \
  86. 'Missing \
  87. printf "%s ", words[i]; \
  88. } \
  89. printf "\n"; \
  90. }' \
  91. | more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...