lamhieu commited on
Commit
207fcd8
·
verified ·
1 Parent(s): 8c13143

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -8
README.md CHANGED
@@ -6,6 +6,8 @@ language:
6
  - vi
7
  pipeline_tag: text-generation
8
  base_model: HuggingFaceH4/zephyr-7b-beta
 
 
9
  ---
10
 
11
  # Model Card for Model ID
@@ -52,8 +54,6 @@ tokenized = pipe.tokenizer(prompt, return_tensors="pt", add_special_tokens=False
52
  outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
53
  results = tokenizer.batch_decode(outputs)[0]
54
  print(results)
55
-
56
- # Output:
57
  # Bệnh dịch hạch ở châu Âu do khuẩn gây ra là do khuẩn Yersinia pestis.
58
  ```
59
 
@@ -67,8 +67,6 @@ tokenized = pipe.tokenizer(prompt, return_tensors="pt", add_special_tokens=False
67
  outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
68
  results = tokenizer.batch_decode(outputs)[0]
69
  print(results)
70
-
71
- # Output:
72
  # Peristernia despecta là một loài ốc biển, là động vật thân mềm chân bụng sống ở biển trong họ Fasciolariidae.
73
  # ...
74
  ```
@@ -83,8 +81,6 @@ tokenized = pipe.tokenizer(prompt, return_tensors="pt", add_special_tokens=False
83
  outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
84
  results = tokenizer.batch_decode(outputs)[0]
85
  print(results)
86
-
87
- # Output:
88
  # Yes, I have knowledge about Vietnam. Vietnam is a country in Southeast Asia, bordered by China to the north, Laos and Cambodia to the west, and the South China Sea to the east and south. Its capital city is Hanoi, and its largest city is Ho Chi Minh City (formerly known as Saigon). Vietnam has a population of approximately 100 million people and a diverse cultural heritage influenced by both Chinese and French colonialism. The country has a rich history, including periods of independence, colonization, and resistance, and has experienced significant economic growth in recent years.
89
  ```
90
 
@@ -98,11 +94,26 @@ tokenized = pipe.tokenizer(prompt, return_tensors="pt", add_special_tokens=False
98
  outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
99
  results = tokenizer.batch_decode(outputs)[0]
100
  print(results)
101
-
102
- # Output
103
  # This is Vietnamese language. Vietnamese is a language spoken mainly in Vietnam and by the Vietnamese diaspora in many other countries. The sentence you provided means "I love you more than you think." It's like you have more love for someone than they realize.
104
  ```
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  ## More Information
107
 
108
  Many thanks for
 
6
  - vi
7
  pipeline_tag: text-generation
8
  base_model: HuggingFaceH4/zephyr-7b-beta
9
+ tags:
10
+ - ghost
11
  ---
12
 
13
  # Model Card for Model ID
 
54
  outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
55
  results = tokenizer.batch_decode(outputs)[0]
56
  print(results)
 
 
57
  # Bệnh dịch hạch ở châu Âu do khuẩn gây ra là do khuẩn Yersinia pestis.
58
  ```
59
 
 
67
  outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
68
  results = tokenizer.batch_decode(outputs)[0]
69
  print(results)
 
 
70
  # Peristernia despecta là một loài ốc biển, là động vật thân mềm chân bụng sống ở biển trong họ Fasciolariidae.
71
  # ...
72
  ```
 
81
  outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
82
  results = tokenizer.batch_decode(outputs)[0]
83
  print(results)
 
 
84
  # Yes, I have knowledge about Vietnam. Vietnam is a country in Southeast Asia, bordered by China to the north, Laos and Cambodia to the west, and the South China Sea to the east and south. Its capital city is Hanoi, and its largest city is Ho Chi Minh City (formerly known as Saigon). Vietnam has a population of approximately 100 million people and a diverse cultural heritage influenced by both Chinese and French colonialism. The country has a rich history, including periods of independence, colonization, and resistance, and has experienced significant economic growth in recent years.
85
  ```
86
 
 
94
  outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
95
  results = tokenizer.batch_decode(outputs)[0]
96
  print(results)
 
 
97
  # This is Vietnamese language. Vietnamese is a language spoken mainly in Vietnam and by the Vietnamese diaspora in many other countries. The sentence you provided means "I love you more than you think." It's like you have more love for someone than they realize.
98
  ```
99
 
100
+ Another example of what you can use to chat multiple turns.
101
+
102
+ ```python
103
+ messages = [
104
+ # {"role": "system", "content": "You are a helpful and knowledgeable assistant. You like to help and always give honest information, in its original language. In communication, you are always respectful, equal and promote positive behavior."},
105
+ {"role": "system", "content": "You are a helpful assistant."}, # Describe to your assistant, anything.
106
+ {"role": "user", "content": "Bla bla bla"},
107
+ {"role": "assistant", "content": "Bla bla bla"},
108
+ {"role": "user", "content": "Bla bla bla"},
109
+ ]
110
+ prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
111
+ tokenized = pipe.tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
112
+ outputs = pipe.model.generate(**tokenized, max_new_tokens=512)
113
+ results = tokenizer.batch_decode(outputs)[0]
114
+ print(results)
115
+ ```
116
+
117
  ## More Information
118
 
119
  Many thanks for