macedonizer
commited on
Commit
•
529f793
1
Parent(s):
e7e3113
Update README.md
Browse files
README.md
CHANGED
@@ -29,30 +29,30 @@ nmodel = AutoModelWithLMHead.from_pretrained('macedonizer/blaze-koneski')
|
|
29 |
|
30 |
input_text = 'Москва '
|
31 |
|
32 |
-
if len(input_text) == 0:
|
33 |
-
encoded_input = tokenizer(input_text, return_tensors="pt")
|
34 |
-
output = model.generate(
|
35 |
-
bos_token_id=random.randint(1, 50000),
|
36 |
-
do_sample=True,
|
37 |
-
top_k=50,
|
38 |
-
max_length=1024,
|
39 |
-
top_p=0.95,
|
40 |
-
num_return_sequences=1,
|
41 |
-
)
|
42 |
-
else:
|
43 |
-
encoded_input = tokenizer(input_text, return_tensors="pt")
|
44 |
-
output = model.generate(
|
45 |
-
**encoded_input,
|
46 |
-
bos_token_id=random.randint(1, 50000),
|
47 |
-
do_sample=True,
|
48 |
-
top_k=50,
|
49 |
-
max_length=1024,
|
50 |
-
top_p=0.95,
|
51 |
-
num_return_sequences=1,
|
52 |
)
|
53 |
|
54 |
-
decoded_output = []
|
55 |
-
for sample in output:
|
56 |
-
decoded_output.append(tokenizer.decode(sample, skip_special_tokens=True))
|
57 |
|
58 |
print(decoded_output)
|
|
|
29 |
|
30 |
input_text = 'Москва '
|
31 |
|
32 |
+
if len(input_text) == 0: \
|
33 |
+
encoded_input = tokenizer(input_text, return_tensors="pt") \
|
34 |
+
output = model.generate( \
|
35 |
+
bos_token_id=random.randint(1, 50000), \
|
36 |
+
do_sample=True, \
|
37 |
+
top_k=50, \
|
38 |
+
max_length=1024, \
|
39 |
+
top_p=0.95, \
|
40 |
+
num_return_sequences=1, \
|
41 |
+
) \
|
42 |
+
else: \
|
43 |
+
encoded_input = tokenizer(input_text, return_tensors="pt") \
|
44 |
+
output = model.generate( \
|
45 |
+
**encoded_input, \
|
46 |
+
bos_token_id=random.randint(1, 50000), \
|
47 |
+
do_sample=True, \
|
48 |
+
top_k=50, \
|
49 |
+
max_length=1024, \
|
50 |
+
top_p=0.95, \
|
51 |
+
num_return_sequences=1, \
|
52 |
)
|
53 |
|
54 |
+
decoded_output = [] \
|
55 |
+
for sample in output: \
|
56 |
+
decoded_output.append(tokenizer.decode(sample, skip_special_tokens=True))
|
57 |
|
58 |
print(decoded_output)
|