You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The simplest way to use an open-source LLM(Large Language Model) is through the tools and pre-trained models hub from huggingface.
20
20
Huggingface is a popular platform for NLP(Natural Language Processing) tasks. It provides a user-friendly interface through the transformers library to load and run various pre-trained models.
21
21
Most open-source models from Huggingface are widely supported and integrated with the transformers library.
22
-
We are keeping our eyes on the latest models and have downloaded some of them for you.
23
-
The full list of all the available models are located at ``/scratch/shareddata/dldata/huggingface-hub-cache/models.txt``. Please contact us if you need any other models.
24
-
The following table lists only a few example from the hosted models:
22
+
We are keeping our eyes on the latest models and have downloaded some of them for you. If you need any other models, please contact us.
25
23
26
-
.. list-table::
27
-
:header-rows: 1
28
-
:widths: 1 1
29
-
30
-
* * Model type
31
-
* Huggingface model identifier
32
-
33
-
* * Text Generation
34
-
* meta-llama/Meta-Llama-3-8B
35
-
36
-
* * Text Generation
37
-
* meta-llama/Meta-Llama-3-8B-Instruct
38
-
39
-
* * Text Generation
40
-
* mistralai/Mixtral-8x22B-v0.1
41
-
42
-
* * Text Generation
43
-
* mistralai/Mixtral-8x22B-Instruct-v0.1
44
-
45
-
* * Text Generation
46
-
* tiiuae/falcon-40b
47
-
48
-
* * Text Generation
49
-
* tiiuae/falcon-40b-instruct
50
-
51
-
* * Text Generation
52
-
* google/gemma-2b-it
53
-
54
-
* * Text Generation
55
-
* google/gemma-7b
56
-
57
-
* * Text Generation
58
-
* google/gemma-7b-it
59
-
60
-
* * Text Generation
61
-
* google/gemma-7b
62
-
63
-
* * Text Generation
64
-
* LumiOpen/Poro-34B
65
-
66
-
67
-
* * Text Generation
68
-
* meta-llama/Llama-2-7b-hf
69
-
70
-
* * Text Generation
71
-
* meta-llama/Llama-2-13b-hf
72
-
73
-
* * Text Generation
74
-
* meta-llama/Llama-2-70b-hf
24
+
Run command ``ls /scratch/shareddata/dldata/huggingface-hub-cache/hub`` to see the full list of all the available models.
75
25
76
-
* * Text Generation
77
-
* codellama/CodeLlama-7b-hf
78
-
79
-
* * Text Generation
80
-
* codellama/CodeLlama-13b-hf
81
-
82
-
* * Text Generation
83
-
* codellama/CodeLlama-34b-hf
84
-
85
-
* * Translation
86
-
* Helsinki-NLP/opus-mt-en-fi
87
-
88
-
* * Translation
89
-
* Helsinki-NLP/opus-mt-fi-en
90
-
91
-
* * Translation
92
-
* t5-base
93
-
94
-
* * Fill Mask
95
-
* bert-base-uncased
96
-
97
-
* * Fill Mask
98
-
* bert-base-cased
99
-
100
-
* * Fill Mask
101
-
* distilbert-base-uncased
102
-
103
-
* * Text to Speech
104
-
* microsoft/speecht5_hifigan
105
-
106
-
* * Text to Speech
107
-
* facebook/hf-seamless-m4t-large
108
-
109
-
* * Automatic Speech Recognition
110
-
* openai/whisper-large-v3
111
-
112
-
* * Token Classification
113
-
* dslim/bert-base-NER-uncased
114
26
115
27
To access Huggingface models:
116
28
117
29
.. tabs::
118
30
119
-
.. group-tab:: slurm script
31
+
.. group-tab:: slurm/shell script
120
32
121
-
Load the module to setup the environment variable HF_HOME:
33
+
Load the module for huggingface models and setup environment variables:
122
34
123
35
.. code-block:: bash
124
-
125
-
module load model-huggingface/all
36
+
126
37
# this will set HF_HOME to /scratch/shareddata/dldata/huggingface-hub-cache
38
+
module load model-huggingface/all
39
+
40
+
# this will force transformer to load model(s) from local hub instead of download and load model(s) from remote hub.
41
+
export TRANSFORMERS_OFFLINE=1
42
+
export HF_HUB_OFFLINE=1
43
+
44
+
python your_script.py
127
45
128
46
.. group-tab:: jupyter notebook
129
47
130
-
In jupyter notebook, one can set up HF_HOME directly:
48
+
In jupyter notebook, one can set up all necessary environment variables directly:
131
49
132
50
.. code-block:: python
133
51
52
+
## Force transformer to load model(s) from local hub instead of download and load model(s) from remote hub.
53
+
## IMPORTANT: This must be executed before importing the transformers library
134
54
import os
135
55
os.environ['TRANSFORMERS_OFFLINE'] ='1'
136
56
os.environ['HF_HUB_OFFLINE'] ='1'
@@ -141,12 +61,6 @@ Here is a Python script using huggingface model.
141
61
142
62
.. code-block:: python
143
63
144
-
## Force transformer to load model(s) from local hub instead of download and load model(s) from remote hub.
145
-
## !!!!!! NOTE: this must be in front of import transformers.
146
-
import os
147
-
os.environ['TRANSFORMERS_OFFLINE'] ='1'
148
-
os.environ['HF_HUB_OFFLINE'] ='1'
149
-
150
64
from transformers import AutoModelForCausalLM, AutoTokenizer
0 commit comments