Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env bash
  2. download()
  3. {
  4. echo "download $1"
  5. # https://stackoverflow.com/questions/3162385/how-to-split-a-string-in-shell-and-get-the-last-field
  6. fn=${1##*/}
  7. if [ ! -f $fn ] ; then
  8. wget --no-check-certificate $1
  9. fi
  10. }
  11. # https://stackoverflow.com/questions/24628076/convert-multiline-string-to-array
  12. names="https://huggingface.co/InfiniFlow/deepdoc/resolve/main/det.onnx
  13. https://huggingface.co/InfiniFlow/deepdoc/resolve/main/layout.laws.onnx
  14. https://huggingface.co/InfiniFlow/deepdoc/resolve/main/layout.manual.onnx
  15. https://huggingface.co/InfiniFlow/deepdoc/resolve/main/layout.onnx
  16. https://huggingface.co/InfiniFlow/deepdoc/resolve/main/layout.paper.onnx
  17. https://huggingface.co/InfiniFlow/deepdoc/resolve/main/ocr.res
  18. https://huggingface.co/InfiniFlow/deepdoc/resolve/main/rec.onnx
  19. https://huggingface.co/InfiniFlow/deepdoc/resolve/main/tsr.onnx
  20. https://huggingface.co/InfiniFlow/text_concat_xgb_v1.0/resolve/main/updown_concat_xgb.model"
  21. SAVEIFS=$IFS # Save current IFS (Internal Field Separator)
  22. IFS=$'\n' # Change IFS to newline char
  23. names=($names) # split the `names` string into an array by the same name
  24. IFS=$SAVEIFS # Restore original IFS
  25. find . -size 0 | xargs rm -f
  26. # https://stackoverflow.com/questions/15466808/shell-iterate-over-array
  27. for ((i=0; i<${#names[@]}; i+=1)); do
  28. url="${names[$i]}"
  29. download $url
  30. if [ $? != 0 ]; then
  31. exit -1
  32. fi
  33. done
  34. find . -size 0 | xargs rm -f