Views
No views yet
git clone https://github.com/ericharper/apex.git
cd apex
git checkout nm_v1.11.0
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--fast_layer_norm" --global-option="--distributed_adam" --global-option="--deprecated_fused_adam" ./pip install nemo_toolkit['nlp']==1.11.0git clone https://github.com/NVIDIA/NeMo.git
cd NeMo/examples/nlp/language_modeling
git checkout v1.11.0
python megatron_gpt_eval.py gpt_model_file=nemo_gpt20B_bf16_tp4.nemo server=True tensor_model_parallel_size=4 trainer.devices=41import json
2import requests
3
4port_num = 5555
5headers = {"Content-Type": "application/json"}
6
7def request_data(data):
8 resp = requests.put('http://localhost:{}/generate'.format(port_num),
9 data=json.dumps(data),
10 headers=headers)
11 sentences = resp.json()['sentences']
12 return sentences
13
14
15data = {
16 "sentences": ["Tell me an interesting fact about space travel."]*1,
17 "tokens_to_generate": 50,
18 "temperature": 1.0,
19 "add_BOS": True,
20 "top_k": 0,
21 "top_p": 0.9,
22 "greedy": False,
23 "all_probs": False,
24 "repetition_penalty": 1.2,
25 "min_tokens_to_generate": 2,
26}
27
28sentences = request_data(data)
29print(sentences)| ARC-Challenge | ARC-Easy | RACE-middle | RACE-high | Winogrande | RTE | BoolQA | HellaSwag | PiQA |
|---|---|---|---|---|---|---|---|---|
| 0.4403 | 0.6141 | 0.5188 | 0.4277 | 0.659 | 0.5704 | 0.6954 | 0.721 | 0.7688 |