Kiet Bui
commited on
Commit
•
a3cdb5a
1
Parent(s):
1404ce3
Update README.md
Browse files
README.md
CHANGED
@@ -37,13 +37,13 @@ There was great political strife in the air, and tensions were high. People rush
|
|
37 |
num_beams=4
|
38 |
)
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
```
|
49 |
|
|
|
37 |
num_beams=4
|
38 |
)
|
39 |
|
40 |
+
text = '[User]: What's the best food in Hanoi?''
|
41 |
+
input_ids = st.session_state.tokenizer(text, return_tensors='pt')['input_ids'].to('cuda')
|
42 |
+
with torch.no_grad():
|
43 |
+
output = st.session_state['model'].generate(input_ids=input_ids, generation_config=st.session_state.gen_config,return_dict_in_generate=True, output_scores=True,max_new_tokens=256)
|
44 |
+
s = output.sequences[0]
|
45 |
+
output = st.session_state.tokenizer.decode(s)
|
46 |
+
print('Raw:',output)
|
47 |
|
48 |
```
|
49 |
|