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

prepare_pt.sh 2.3 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
  1. #!/bin/bash
  2. #
  3. # Container source: https://github.com/runpod/containers/blob/main/torch/Dockerfile
  4. #
  5. # This script:
  6. # - cleaned up `prepare_runpod.sh`
  7. # - adapted https://github.com/runpod/containers/tree/main/oobabooga
  8. #
  9. # To run this in RunPod with `runpod/pytorch:3.10-1.13.1-116`, set
  10. # Expose HTTP Ports (Max 10): 7860,8888
  11. # docker command: `bash -c "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/utensil/llm-playground/main/scripts/entry/prepare_pt.sh -sSf | bash"`
  12. # WEBUI chatbot
  13. # JUPYTER_PASSWORD change to your secret
  14. # HUGGINGFACE_TOKEN change to your token from https://huggingface.co/settings/tokens
  15. # SUDO nosudo
  16. # WORKSPACE /workspace/
  17. #
  18. # To test this in Codespaces, run `cd /workspaces/ && WORKSPACE=/workspaces/ llm-playground/scripts/entry/prepare_pt.sh`
  19. set -euxo pipefail
  20. set -x
  21. CODESPACES=${CODESPACES:-""}
  22. WORKSPACE=${WORKSPACE:-"/workspace"}
  23. cd $WORKSPACE
  24. if [ ! -d "llm-playground" ]; then
  25. git clone https://github.com/utensil/llm-playground
  26. fi
  27. cd llm-playground
  28. export DEBIAN_FRONTEND=noninteractive
  29. ./helper/prepare.sh
  30. cd $WORKSPACE/llm-playground
  31. LOAD_MODEL=${LOAD_MODEL:-""}
  32. LOAD_DATASET=${LOAD_DATASET:-""}
  33. if [ ! -z "$LOAD_MODEL" ]; then
  34. python ./helper/download-model.py $LOAD_MODEL
  35. fi
  36. if [ ! -z "$LOAD_DATASET" ]; then
  37. python ./helper/download-dataset.py $LOAD_DATASET
  38. fi
  39. mkdir -p $WORKSPACE/llm-playground/models
  40. mkdir -p $WORKSPACE/llm-playground/loras
  41. mkdir -p $WORKSPACE/llm-playground/datasets
  42. python ./helper/storage.py
  43. # cd notebooks
  44. # pip3 install -r requirements.txt
  45. cd $WORKSPACE
  46. if [ ! -d "text-generation-webui" ]; then
  47. git clone https://github.com/oobabooga/text-generation-webui
  48. fi
  49. cd $WORKSPACE/text-generation-webui/
  50. # git pull
  51. # pip3 install -r requirements.txt
  52. TMP=$WORKSPACE/tmp/
  53. rm -rf $TMP
  54. mkdir -p $TMP
  55. mv models $TMP
  56. mv loras $TMP
  57. mv training/datasets $TMP
  58. ln -s $WORKSPACE/llm-playground/models ./models
  59. ln -s $WORKSPACE/llm-playground/loras ./loras
  60. ln -s $WORKSPACE/llm-playground/datasets ./training/datasets
  61. cp $WORKSPACE/llm-playground/storage/3b.txt ./training/datasets/3b.txt
  62. JUPYTER_PASSWORD=${JUPYTER_PASSWORD:-"pytorch"}
  63. if [[ $JUPYTER_PASSWORD ]]
  64. then
  65. echo "Launching Jupyter Lab"
  66. cd /
  67. nohup jupyter lab --allow-root --no-browser --port=8888 --ip=* --ServerApp.token=$JUPYTER_PASSWORD --ServerApp.allow_origin=* --ServerApp.preferred_dir=$WORKSPACE &
  68. fi
  69. sleep infinity
Tip!

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

Comments

Loading...