Advertisement
Guest User

Untitled

a guest
Mar 26th, 2023
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1.  
  2. powershell -ExecutionPolicy ByPass -NoExit -Command "& 'C:\Users\myself\miniconda3\shell\condabin\conda-hook.ps1' ; conda activate 'C:\Users\myself\miniconda3'
  3.  
  4. miniconda link: https://docs.conda.io/en/latest/miniconda.html
  5. cuda information link: https://github.com/bycloudai/SwapCudaVersionWindows
  6. 8bit modification link: https://www.reddit.com/r/LocalLLaMA/comments/11o6o3f/how_to_install_llama_8bit_and_4bit/
  7.  
  8. conda create -n textgen python=3.10.9
  9.  
  10. conda activate textgen
  11.  
  12. conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
  13.  
  14. conda install -c conda-forge cudatoolkit=11.7
  15. conda install -c conda-forge ninja
  16. conda install -c conda-forge accelerate
  17. conda install -c conda-forge sentencepiece
  18. pip install git+https://github.com/huggingface/transformers.git
  19. pip install git+https://github.com/huggingface/peft.git
  20.  
  21.  
  22. cd F:\OoBaboogaMarch17\
  23.  
  24. git clone https://github.com/oobabooga/text-generation-webui
  25. cd text-generation-webui
  26. pip install -r requirements.txt
  27.  
  28. ******************************** Testing model to make sure things are working
  29. cd F:\OoBaboogaMarch17\text-generation-webui
  30. conda activate textgen
  31. python .\server.py --auto-devices --cai-chat
  32. ******************************** Testing model to make sure things are working, things are good!
  33.  
  34.  
  35. Now do 8bit modifications
  36.  
  37.  
  38. ******************************** Testing model to make sure things are working in 8bit
  39. cd F:\OoBaboogaMarch17\text-generation-webui
  40. conda activate textgen
  41. python .\server.py --auto-devices --load-in-8bit --cai-chat
  42. ******************************** Testing model to make sure things are working, things are good!
  43.  
  44. cd F:\OoBaboogaMarch17\text-generation-webui
  45. conda activate textgen
  46. mkdir repositories
  47. cd repositories
  48. git clone https://github.com/qwopqwop200/GPTQ-for-LLaMa
  49. cd GPTQ-for-LLaMa
  50. python setup_cuda.py install
  51.  
  52.  
  53. ******************************** Convert Weights of original LLaMA Model *Make sure to move tokenizer files too!!
  54. cd F:\OoBaboogaMarch17\text-generation-webui\repositories\GPTQ-for-LLaMa
  55. conda activate textgen
  56. python convert_llama_weights_to_hf.py --input_dir F:\OoBaboogaMarch17\text-generation-webui\models --model_size 13B --output_dir F:\OoBaboogaMarch17\text-generation-webui\models\llama-13b
  57.  
  58. *example formating*
  59. python convert_llama_weights_to_hf.py --input_dir /path/to/downloaded/llama/weights --model_size 7B --output_dir ./llama-hf
  60. ******************************** Convert Weights of original LLaMA Model
  61.  
  62.  
  63. ******************************** Testing model to make sure things are working in 8bit
  64. cd F:\OoBaboogaMarch17\text-generation-webui
  65. conda activate textgen
  66. python .\server.py --auto-devices --load-in-8bit --cai-chat
  67. ******************************** Testing model to make sure things are working, things are good!
  68.  
  69. cd F:\OoBaboogaMarch17\text-generation-webui
  70. conda activate textgen
  71. conda install datasets -c conda-forge
  72.  
  73. ******************************** CREATE 4-BIT Addon Model
  74. **ATTENTION ATTENTION PAY ATTENTION TO THE DIRECTION OF THE SLASHES WHEN TELLIGN THIS CODE THE DIRECTORY THE ARE / NOT \
  75. cd F:\OoBaboogaMarch17\text-generation-webui\repositories\GPTQ-for-LLaMa
  76. conda activate textgen
  77. python llama.py F:/OoBaboogaMarch17/text-generation-webui/models/llama-13b c4 --wbits 4 --groupsize 128 --save llama-13b-4bit.pt
  78. ******************************** Convert Weights of original LLaMA Model
  79.  
  80. ******************************** Testing model to make sure things are working in 4 bit
  81. cd F:\OoBaboogaMarch17\text-generation-webui
  82. conda activate textgen
  83. python server.py --wbits 4 --groupsize 128 --cai-chat
  84. ******************************** Testing model to make sure things are working , things are good!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement