Zen1t commited on
Commit
0e0ef07
·
verified ·
1 Parent(s): a4f3bed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -8
README.md CHANGED
@@ -11,7 +11,8 @@ from transformers import AutoTokenizer
11
  import transformers
12
  import torch
13
  model = "Zen1t/WordWeaver-AI"
14
- prompt = "Who is Leonardo Da Vinci?"
 
15
  tokenizer = AutoTokenizer.from_pretrained(model)
16
  pipeline = transformers.pipeline(
17
  "text-generation",
@@ -20,7 +21,7 @@ pipeline = transformers.pipeline(
20
  device_map="auto",
21
  )
22
  sequences = pipeline(
23
- f'<s>[INST] {prompt} [/INST]',
24
  do_sample=True,
25
  top_k=10,
26
  num_return_sequences=1,
@@ -28,14 +29,10 @@ sequences = pipeline(
28
  max_length=200,
29
  )
30
  for seq in sequences:
31
- print(f"Result: {seq['generated_text']}")
32
  ```
33
 
34
  **Output**
35
  ```
36
- Result: <s>[INST] Who is Leonardo Da Vinci? [/INST] Leonardo da Vinci (1452-1519) was a famous Italian polymath, artist, and inventor. (polymath: a person who knows a lot about many different subjects). He is considered one of the greatest painters of all time, and his paintings have had a big influence on many people who have lived after him.
37
- As an artist, Leonardo da Vinci painted beautiful paintings using his skills and knowledge. Some of his most famous paintings are:
38
- * The Mona Lisa: a painting of a woman who is smiling mysteriously, and is considered one of the greatest works of art of the Renaissance.
39
- * The Last Supper: a mural painting depicting the last meal Jesus shared with his twelve disciples before he died.
40
- * The Virgin and Child with St. Anne and St. John the
41
  ```
 
11
  import transformers
12
  import torch
13
  model = "Zen1t/WordWeaver-AI"
14
+ prompt = "Сегодня он собирался удивить Аню сюрпризом — отвезти её в ресторан, заслуживающий особого внимания из-за своего расположения. А располагался тот на двадцать пятом этаже здания «Российской Академии Наук». Из его окон, судя по описанию, открывался изумительный вид на город, особенно ночью."
15
+ prompt = f"<s>[INST] {prompt} [/INST]"
16
  tokenizer = AutoTokenizer.from_pretrained(model)
17
  pipeline = transformers.pipeline(
18
  "text-generation",
 
21
  device_map="auto",
22
  )
23
  sequences = pipeline(
24
+ prompt,
25
  do_sample=True,
26
  top_k=10,
27
  num_return_sequences=1,
 
29
  max_length=200,
30
  )
31
  for seq in sequences:
32
+ print(seq['generated_text'][len(prompt):])
33
  ```
34
 
35
  **Output**
36
  ```
37
+ Сегодня он собирался удивить Аню сюрпризом отвезти ее в ресторан, заслуживающий особого внимания из-за своего расположения на двадцать пятом этаже здания «Российской Академии Наук». Из его окон, судя по описанию, открывался изумительный вид на город, особенно ночью.
 
 
 
 
38
  ```