k4d3 commited on
Commit
13a561f
1 Parent(s): 7607e01

i messed up zsh

Browse files

Signed-off-by: Balazs Horvath <acsipont@gmail.com>

Files changed (1) hide show
  1. .zshrc +34 -9
.zshrc CHANGED
@@ -1,3 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  alias ezc="nvim ~/.zshrc && source ~/.zshrc"
2
 
3
  # This function, rejiggle_captions, takes two arguments: a tag and a directory.
@@ -56,7 +80,7 @@ update_conda() {
56
  export LANG=ja_JP.UTF-8
57
  export LC_ALL=ja_JP.UTF-8
58
 
59
- function list_word_freqs() {
60
  local target_dir=$1
61
  if [[ -z "$target_dir" ]]; then
62
  echo "Usage: list_word_freqs <target_directory>"
@@ -113,7 +137,7 @@ sample_prompts() {
113
  done
114
  }
115
 
116
- # Function: replace_comma_with_keep_tags
117
  # Description: This function replaces the specified occurrence of a comma with " |||" in all *.txt files
118
  # in all subdirectories of a target directory or the current directory when no path is passed.
119
  # Usage: replace_comma_with_keep_tags <occurrence_number> [target_directory]
@@ -230,7 +254,7 @@ export RUST_BACKTRACE=1
230
  # It extracts the version number from the `nvcc --version` command output.
231
  # The version number is then formatted by removing the dot (e.g., 12.6 becomes 126).
232
  # Finally, the function returns the formatted version number.
233
- function nv() {
234
  # Get the nvcc version output
235
  local nvcc_output=$(nvcc --version)
236
 
@@ -252,7 +276,7 @@ remove_repetition() {
252
  # Find all .txt files in the specified directory and process each file
253
  find "$dir" -type f -name "*.txt" | while read -r file; do
254
  # Use awk to process each line of the file
255
- awk '
256
  {
257
  n = split($0, words, " ") # Split the line into words
258
  for (i = n; i > 1; i--) { # Iterate from the last word to the second word
@@ -262,7 +286,9 @@ remove_repetition() {
262
  printf "%s%s", words[j], (j == i ? ORS : OFS) # Print the word followed by a space or newline
263
  }
264
  }
265
- ' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file" # Save the processed content to a temporary file and replace the original file
 
 
266
  done
267
  }
268
 
@@ -459,7 +485,7 @@ chop_lora() {
459
  ["all"] = "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
460
  ["allin"] = "1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0"
461
  ["allmid"] = "1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0"
462
- ["allout"] = "1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1"
463
  )
464
 
465
  for preset in ${(k)presets}; do
@@ -470,7 +496,7 @@ chop_lora() {
470
  done
471
  }
472
 
473
- function swch() {
474
  if [ -z "$1" ]; then
475
  echo "Please provide a branch name."
476
  return 1
@@ -564,7 +590,6 @@ seed() {
564
  import safetensors, json
565
  filePath = '$filePath'
566
  print(json.loads(safetensors.safe_open(filePath, 'np').metadata().get('ss_seed', 'Not found')))
567
- "
568
  }
569
 
570
  png2mp4() {
@@ -627,7 +652,7 @@ unset __conda_setup
627
 
628
  unset CONDA_CHANGEPS1
629
 
630
- function conda_prompt_info() {
631
  if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
632
  echo "(${CONDA_DEFAULT_ENV})"
633
  fi
 
1
+ # ⚠️ TODO: This needs to be benched but I'm too bad at this!
2
+ export NUMEXPR_MAX_THREADS=24
3
+ export VECLIB_MAXIMUM_THREADS=24
4
+ export MKL_NUM_THREADS=24
5
+ export OMP_NUM_THREADS=24
6
+
7
+ display_git_help() {
8
+ echo "Git"
9
+ echo "---"
10
+ echo "ga: \`git add . && git commit -avs --verbose && git push\`"
11
+ echo "gc: \`git commit -avs --verbose\`"
12
+ echo "gcs: \`git clone --recurse-submodules\`"
13
+ echo "grh: \`git reset --hard\`"
14
+ echo "wd: \`git diff --word-diff-regex='[^,]+' --patience\`"
15
+ echo "gs: \`git status\`"
16
+ echo "gcx: \`git clean -fxd\`"
17
+ }
18
+ display_git_help
19
+
20
+ export CLICOLOR=126
21
+
22
+ alias gc="git commit -avs --verbose"
23
+ alias dir="dir --color=always"
24
+ alias ll="ls -lah --color=always"
25
  alias ezc="nvim ~/.zshrc && source ~/.zshrc"
26
 
27
  # This function, rejiggle_captions, takes two arguments: a tag and a directory.
 
80
  export LANG=ja_JP.UTF-8
81
  export LC_ALL=ja_JP.UTF-8
82
 
83
+ list_word_freqs() {
84
  local target_dir=$1
85
  if [[ -z "$target_dir" ]]; then
86
  echo "Usage: list_word_freqs <target_directory>"
 
137
  done
138
  }
139
 
140
+ # replace_comma_with_keep_tags
141
  # Description: This function replaces the specified occurrence of a comma with " |||" in all *.txt files
142
  # in all subdirectories of a target directory or the current directory when no path is passed.
143
  # Usage: replace_comma_with_keep_tags <occurrence_number> [target_directory]
 
254
  # It extracts the version number from the `nvcc --version` command output.
255
  # The version number is then formatted by removing the dot (e.g., 12.6 becomes 126).
256
  # Finally, the function returns the formatted version number.
257
+ nv() {
258
  # Get the nvcc version output
259
  local nvcc_output=$(nvcc --version)
260
 
 
276
  # Find all .txt files in the specified directory and process each file
277
  find "$dir" -type f -name "*.txt" | while read -r file; do
278
  # Use awk to process each line of the file
279
+ awk
280
  {
281
  n = split($0, words, " ") # Split the line into words
282
  for (i = n; i > 1; i--) { # Iterate from the last word to the second word
 
286
  printf "%s%s", words[j], (j == i ? ORS : OFS) # Print the word followed by a space or newline
287
  }
288
  }
289
+
290
+ # Save the processed content to a temporary file and replace the original file
291
+ "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
292
  done
293
  }
294
 
 
485
  ["all"] = "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
486
  ["allin"] = "1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0"
487
  ["allmid"] = "1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0"
488
+ ["al"lout"] = "1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1"
489
  )
490
 
491
  for preset in ${(k)presets}; do
 
496
  done
497
  }
498
 
499
+ swch() {
500
  if [ -z "$1" ]; then
501
  echo "Please provide a branch name."
502
  return 1
 
590
  import safetensors, json
591
  filePath = '$filePath'
592
  print(json.loads(safetensors.safe_open(filePath, 'np').metadata().get('ss_seed', 'Not found')))
 
593
  }
594
 
595
  png2mp4() {
 
652
 
653
  unset CONDA_CHANGEPS1
654
 
655
+ conda_prompt_info() {
656
  if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
657
  echo "(${CONDA_DEFAULT_ENV})"
658
  fi