okuchaiev commited on
Commit
96ac9a1
1 Parent(s): 3edf4fd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -0
README.md CHANGED
@@ -59,6 +59,39 @@ git checkout v1.11.0
59
  python megatron_gpt_eval.py gpt_model_file=nemo_gpt5B_fp16.nemo server=True tensor_model_parallel_size=1 trainer.devices=1
60
  ```
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  ## Training Data
64
 
 
59
  python megatron_gpt_eval.py gpt_model_file=nemo_gpt5B_fp16.nemo server=True tensor_model_parallel_size=1 trainer.devices=1
60
  ```
61
 
62
+ ### Step 3: Send prompts to you model!
63
+ ```python
64
+ import json
65
+ import requests
66
+
67
+ port_num = 5555
68
+ headers = {"Content-Type": "application/json"}
69
+
70
+ def request_data(data):
71
+ resp = requests.put('http://localhost:{}/generate'.format(port_num),
72
+ data=json.dumps(data),
73
+ headers=headers)
74
+ sentences = resp.json()['sentences']
75
+ return sentences
76
+
77
+
78
+ data = {
79
+ "sentences": ["Tell me an interesting fact about space travel."]*1,
80
+ "tokens_to_generate": 50,
81
+ "temperature": 1.0,
82
+ "add_BOS": True,
83
+ "top_k": 0,
84
+ "top_p": 0.9,
85
+ "greedy": False,
86
+ "all_probs": False,
87
+ "repetition_penalty": 1.2,
88
+ "min_tokens_to_generate": 2,
89
+ }
90
+
91
+ sentences = request_data(data)
92
+ print(sentences)
93
+ ```
94
+
95
 
96
  ## Training Data
97