crfm-helm 0.5.2__py3-none-any.whl → 0.5.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of crfm-helm might be problematic. Click here for more details.

Files changed (184) hide show
  1. {crfm_helm-0.5.2.dist-info → crfm_helm-0.5.3.dist-info}/METADATA +29 -55
  2. {crfm_helm-0.5.2.dist-info → crfm_helm-0.5.3.dist-info}/RECORD +146 -134
  3. {crfm_helm-0.5.2.dist-info → crfm_helm-0.5.3.dist-info}/WHEEL +1 -1
  4. helm/benchmark/adaptation/adapters/multiple_choice_joint_adapter.py +12 -5
  5. helm/benchmark/adaptation/adapters/test_generation_adapter.py +12 -12
  6. helm/benchmark/adaptation/adapters/test_language_modeling_adapter.py +8 -8
  7. helm/benchmark/adaptation/adapters/test_multiple_choice_joint_adapter.py +77 -9
  8. helm/benchmark/adaptation/common_adapter_specs.py +2 -0
  9. helm/benchmark/annotation/anthropic_red_team_annotator.py +70 -0
  10. helm/benchmark/annotation/call_center_annotator.py +247 -0
  11. helm/benchmark/annotation/financebench_annotator.py +79 -0
  12. helm/benchmark/annotation/harm_bench_annotator.py +68 -0
  13. helm/benchmark/annotation/{image2structure → image2struct}/latex_compiler_annotator.py +2 -2
  14. helm/benchmark/annotation/{image2structure → image2struct}/lilypond_compiler_annotator.py +5 -3
  15. helm/benchmark/annotation/{image2structure → image2struct}/webpage_compiler_annotator.py +5 -5
  16. helm/benchmark/annotation/live_qa_annotator.py +32 -45
  17. helm/benchmark/annotation/medication_qa_annotator.py +31 -44
  18. helm/benchmark/annotation/model_as_judge.py +45 -0
  19. helm/benchmark/annotation/simple_safety_tests_annotator.py +64 -0
  20. helm/benchmark/annotation/xstest_annotator.py +110 -0
  21. helm/benchmark/metrics/annotation_metrics.py +108 -0
  22. helm/benchmark/metrics/bhasa_metrics.py +188 -0
  23. helm/benchmark/metrics/bhasa_metrics_specs.py +10 -0
  24. helm/benchmark/metrics/code_metrics_helper.py +11 -1
  25. helm/benchmark/metrics/safety_metrics.py +57 -0
  26. helm/benchmark/metrics/summac/model_summac.py +3 -3
  27. helm/benchmark/metrics/tokens/test_ai21_token_cost_estimator.py +2 -2
  28. helm/benchmark/metrics/tokens/test_openai_token_cost_estimator.py +4 -4
  29. helm/benchmark/metrics/vision_language/image_metrics.py +1 -1
  30. helm/benchmark/metrics/vision_language/image_utils.py +1 -1
  31. helm/benchmark/model_metadata_registry.py +3 -3
  32. helm/benchmark/presentation/test_run_entry.py +1 -0
  33. helm/benchmark/run.py +15 -0
  34. helm/benchmark/run_expander.py +56 -30
  35. helm/benchmark/run_specs/bhasa_run_specs.py +638 -0
  36. helm/benchmark/run_specs/call_center_run_specs.py +152 -0
  37. helm/benchmark/run_specs/decodingtrust_run_specs.py +8 -8
  38. helm/benchmark/run_specs/experimental_run_specs.py +52 -0
  39. helm/benchmark/run_specs/finance_run_specs.py +78 -1
  40. helm/benchmark/run_specs/safety_run_specs.py +154 -0
  41. helm/benchmark/run_specs/vlm_run_specs.py +92 -21
  42. helm/benchmark/scenarios/anthropic_red_team_scenario.py +71 -0
  43. helm/benchmark/scenarios/banking77_scenario.py +51 -0
  44. helm/benchmark/scenarios/bhasa_scenario.py +1798 -0
  45. helm/benchmark/scenarios/call_center_scenario.py +84 -0
  46. helm/benchmark/scenarios/decodingtrust_stereotype_bias_scenario.py +2 -1
  47. helm/benchmark/scenarios/ewok_scenario.py +116 -0
  48. helm/benchmark/scenarios/fin_qa_scenario.py +2 -0
  49. helm/benchmark/scenarios/financebench_scenario.py +53 -0
  50. helm/benchmark/scenarios/harm_bench_scenario.py +59 -0
  51. helm/benchmark/scenarios/scenario.py +1 -1
  52. helm/benchmark/scenarios/simple_safety_tests_scenario.py +33 -0
  53. helm/benchmark/scenarios/test_commonsense_scenario.py +21 -0
  54. helm/benchmark/scenarios/test_ewok_scenario.py +25 -0
  55. helm/benchmark/scenarios/test_financebench_scenario.py +26 -0
  56. helm/benchmark/scenarios/test_gsm_scenario.py +31 -0
  57. helm/benchmark/scenarios/test_legalbench_scenario.py +30 -0
  58. helm/benchmark/scenarios/test_math_scenario.py +2 -8
  59. helm/benchmark/scenarios/test_med_qa_scenario.py +30 -0
  60. helm/benchmark/scenarios/test_mmlu_scenario.py +33 -0
  61. helm/benchmark/scenarios/test_narrativeqa_scenario.py +73 -0
  62. helm/benchmark/scenarios/thai_exam_scenario.py +4 -4
  63. helm/benchmark/scenarios/vision_language/a_okvqa_scenario.py +1 -1
  64. helm/benchmark/scenarios/vision_language/bingo_scenario.py +2 -2
  65. helm/benchmark/scenarios/vision_language/crossmodal_3600_scenario.py +2 -1
  66. helm/benchmark/scenarios/vision_language/exams_v_scenario.py +104 -0
  67. helm/benchmark/scenarios/vision_language/fair_face_scenario.py +136 -0
  68. helm/benchmark/scenarios/vision_language/flickr30k_scenario.py +1 -1
  69. helm/benchmark/scenarios/vision_language/gqa_scenario.py +2 -2
  70. helm/benchmark/scenarios/vision_language/hateful_memes_scenario.py +1 -1
  71. helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/chart2csv_scenario.py +1 -1
  72. helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/latex_scenario.py +3 -3
  73. helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/musicsheet_scenario.py +1 -1
  74. helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/utils_latex.py +31 -39
  75. helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/webpage/driver.py +1 -1
  76. helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/webpage/utils.py +1 -1
  77. helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/webpage_scenario.py +41 -12
  78. helm/benchmark/scenarios/vision_language/math_vista_scenario.py +1 -1
  79. helm/benchmark/scenarios/vision_language/mementos_scenario.py +3 -3
  80. helm/benchmark/scenarios/vision_language/mm_safety_bench_scenario.py +2 -2
  81. helm/benchmark/scenarios/vision_language/mme_scenario.py +21 -18
  82. helm/benchmark/scenarios/vision_language/mmmu_scenario.py +1 -1
  83. helm/benchmark/scenarios/vision_language/pairs_scenario.py +1 -1
  84. helm/benchmark/scenarios/vision_language/pope_scenario.py +2 -1
  85. helm/benchmark/scenarios/vision_language/real_world_qa_scenario.py +57 -0
  86. helm/benchmark/scenarios/vision_language/seed_bench_scenario.py +7 -5
  87. helm/benchmark/scenarios/vision_language/unicorn_scenario.py +2 -2
  88. helm/benchmark/scenarios/vision_language/vibe_eval_scenario.py +6 -3
  89. helm/benchmark/scenarios/vision_language/viz_wiz_scenario.py +1 -1
  90. helm/benchmark/scenarios/vision_language/vqa_scenario.py +3 -1
  91. helm/benchmark/scenarios/xstest_scenario.py +35 -0
  92. helm/benchmark/server.py +1 -6
  93. helm/benchmark/static/schema_air_bench.yaml +750 -750
  94. helm/benchmark/static/schema_bhasa.yaml +709 -0
  95. helm/benchmark/static/schema_call_center.yaml +232 -0
  96. helm/benchmark/static/schema_cleva.yaml +768 -0
  97. helm/benchmark/static/schema_decodingtrust.yaml +444 -0
  98. helm/benchmark/static/schema_ewok.yaml +367 -0
  99. helm/benchmark/static/schema_finance.yaml +55 -9
  100. helm/benchmark/static/{schema_image2structure.yaml → schema_image2struct.yaml} +231 -90
  101. helm/benchmark/static/schema_safety.yaml +247 -0
  102. helm/benchmark/static/schema_tables.yaml +124 -7
  103. helm/benchmark/static/schema_thai.yaml +21 -0
  104. helm/benchmark/static/schema_vhelm.yaml +96 -91
  105. helm/benchmark/static_build/assets/accenture-6f97eeda.png +0 -0
  106. helm/benchmark/static_build/assets/aisingapore-6dfc9acf.png +0 -0
  107. helm/benchmark/static_build/assets/cresta-9e22b983.png +0 -0
  108. helm/benchmark/static_build/assets/cuhk-8c5631e9.png +0 -0
  109. helm/benchmark/static_build/assets/index-05c76bb1.css +1 -0
  110. helm/benchmark/static_build/assets/index-58f97dcd.js +10 -0
  111. helm/benchmark/static_build/assets/scb10x-204bd786.png +0 -0
  112. helm/benchmark/static_build/assets/wellsfargo-a86a6c4a.png +0 -0
  113. helm/benchmark/static_build/index.html +2 -2
  114. helm/benchmark/window_services/test_openai_window_service.py +8 -8
  115. helm/clients/ai21_client.py +71 -1
  116. helm/clients/anthropic_client.py +7 -19
  117. helm/clients/huggingface_client.py +38 -37
  118. helm/clients/nvidia_nim_client.py +35 -0
  119. helm/clients/openai_client.py +2 -3
  120. helm/clients/palmyra_client.py +25 -0
  121. helm/clients/perspective_api_client.py +11 -6
  122. helm/clients/test_client.py +4 -6
  123. helm/clients/vision_language/open_flamingo_client.py +1 -2
  124. helm/clients/vision_language/palmyra_vision_client.py +28 -13
  125. helm/common/images_utils.py +6 -0
  126. helm/common/mongo_key_value_store.py +2 -1
  127. helm/common/request.py +16 -0
  128. helm/config/model_deployments.yaml +315 -332
  129. helm/config/model_metadata.yaml +384 -110
  130. helm/config/tokenizer_configs.yaml +116 -11
  131. helm/proxy/example_queries.py +14 -21
  132. helm/proxy/services/server_service.py +1 -2
  133. helm/proxy/token_counters/test_auto_token_counter.py +2 -2
  134. helm/tokenizers/ai21_tokenizer.py +51 -59
  135. helm/tokenizers/cohere_tokenizer.py +0 -75
  136. helm/tokenizers/huggingface_tokenizer.py +0 -1
  137. helm/tokenizers/test_ai21_tokenizer.py +48 -0
  138. helm/benchmark/static/benchmarking.css +0 -156
  139. helm/benchmark/static/benchmarking.js +0 -1705
  140. helm/benchmark/static/config.js +0 -3
  141. helm/benchmark/static/general.js +0 -122
  142. helm/benchmark/static/images/crfm-logo.png +0 -0
  143. helm/benchmark/static/images/helm-logo-simple.png +0 -0
  144. helm/benchmark/static/images/helm-logo.png +0 -0
  145. helm/benchmark/static/images/language-model-helm.png +0 -0
  146. helm/benchmark/static/images/organizations/ai21.png +0 -0
  147. helm/benchmark/static/images/organizations/anthropic.png +0 -0
  148. helm/benchmark/static/images/organizations/bigscience.png +0 -0
  149. helm/benchmark/static/images/organizations/cohere.png +0 -0
  150. helm/benchmark/static/images/organizations/eleutherai.png +0 -0
  151. helm/benchmark/static/images/organizations/google.png +0 -0
  152. helm/benchmark/static/images/organizations/meta.png +0 -0
  153. helm/benchmark/static/images/organizations/microsoft.png +0 -0
  154. helm/benchmark/static/images/organizations/nvidia.png +0 -0
  155. helm/benchmark/static/images/organizations/openai.png +0 -0
  156. helm/benchmark/static/images/organizations/together.png +0 -0
  157. helm/benchmark/static/images/organizations/tsinghua-keg.png +0 -0
  158. helm/benchmark/static/images/organizations/yandex.png +0 -0
  159. helm/benchmark/static/images/scenarios-by-metrics.png +0 -0
  160. helm/benchmark/static/images/taxonomy-scenarios.png +0 -0
  161. helm/benchmark/static/index.html +0 -68
  162. helm/benchmark/static/info-icon.png +0 -0
  163. helm/benchmark/static/json-urls.js +0 -69
  164. helm/benchmark/static/plot-captions.js +0 -27
  165. helm/benchmark/static/utils.js +0 -285
  166. helm/benchmark/static_build/assets/index-30dbceba.js +0 -10
  167. helm/benchmark/static_build/assets/index-66b02d40.css +0 -1
  168. helm/benchmark/window_services/ai21_window_service.py +0 -247
  169. helm/benchmark/window_services/cohere_window_service.py +0 -101
  170. helm/benchmark/window_services/test_ai21_window_service.py +0 -163
  171. helm/benchmark/window_services/test_cohere_window_service.py +0 -75
  172. helm/benchmark/window_services/test_cohere_window_service_utils.py +0 -8328
  173. helm/benchmark/window_services/test_ice_window_service.py +0 -327
  174. helm/tokenizers/ice_tokenizer.py +0 -30
  175. helm/tokenizers/test_ice_tokenizer.py +0 -57
  176. {crfm_helm-0.5.2.dist-info → crfm_helm-0.5.3.dist-info}/LICENSE +0 -0
  177. {crfm_helm-0.5.2.dist-info → crfm_helm-0.5.3.dist-info}/entry_points.txt +0 -0
  178. {crfm_helm-0.5.2.dist-info → crfm_helm-0.5.3.dist-info}/top_level.txt +0 -0
  179. /helm/benchmark/annotation/{image2structure → image2struct}/__init__.py +0 -0
  180. /helm/benchmark/annotation/{image2structure → image2struct}/image_compiler_annotator.py +0 -0
  181. /helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/__init__.py +0 -0
  182. /helm/benchmark/scenarios/vision_language/{image2structure/image2structure_scenario.py → image2struct/image2struct_scenario.py} +0 -0
  183. /helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/webpage/__init__.py +0 -0
  184. /helm/benchmark/scenarios/vision_language/{image2structure → image2struct}/webpage/jekyll_server.py +0 -0
@@ -1,327 +0,0 @@
1
- import shutil
2
- import tempfile
3
- from typing import List
4
-
5
- from helm.common.cache_backend_config import BlackHoleCacheBackendConfig
6
- from .tokenizer_service import TokenizerService
7
- from .window_service_factory import WindowServiceFactory
8
- from .test_utils import get_tokenizer_service, TEST_PROMPT
9
-
10
-
11
- class TestICEWindowService:
12
- # According to https://github.com/THUDM/icetk, token id [20100, 83823) are English tokens.
13
- TEST_TOKEN_IDS: List[int] = [
14
- 20123,
15
- 21490,
16
- 20108,
17
- 22581,
18
- 20111,
19
- 22430,
20
- 48828,
21
- 20019,
22
- 21172,
23
- 27993,
24
- 20014,
25
- 20107,
26
- 20125,
27
- 20105,
28
- 44550,
29
- 27193,
30
- 22258,
31
- 20165,
32
- 20101,
33
- 20100,
34
- 33572,
35
- 22661,
36
- 20108,
37
- 24235,
38
- 20011,
39
- 28882,
40
- 20201,
41
- 59599,
42
- 30558,
43
- 20019,
44
- 68731,
45
- 20014,
46
- 20109,
47
- 24853,
48
- 20103,
49
- 20238,
50
- 24878,
51
- 27849,
52
- 20105,
53
- 20100,
54
- 20299,
55
- 20006,
56
- 20549,
57
- 20006,
58
- 20102,
59
- 28808,
60
- 20101,
61
- 25898,
62
- 21195,
63
- 20007,
64
- ]
65
-
66
- def setup_method(self):
67
- self.path: str = tempfile.mkdtemp()
68
- service: TokenizerService = get_tokenizer_service(self.path, BlackHoleCacheBackendConfig())
69
- self.window_service = WindowServiceFactory.get_window_service("together/glm", service)
70
-
71
- def teardown_method(self, method):
72
- shutil.rmtree(self.path)
73
-
74
- def test_max_request_length(self):
75
- assert self.window_service.max_request_length == 2049
76
-
77
- def test_encode(self):
78
- assert self.window_service.encode(TEST_PROMPT).token_values == TestICEWindowService.TEST_TOKEN_IDS
79
-
80
- def test_decode(self):
81
- assert self.window_service.decode(self.window_service.encode(TEST_PROMPT).tokens) == TEST_PROMPT
82
-
83
- def test_tokenize(self):
84
- assert self.window_service.tokenize(TEST_PROMPT) == [
85
- " The",
86
- " Center",
87
- " for",
88
- " Research",
89
- " on",
90
- " Foundation",
91
- " Models",
92
- " (",
93
- "CR",
94
- "FM",
95
- ")",
96
- " is",
97
- " an",
98
- " in",
99
- "terdisciplinary",
100
- " initiative",
101
- " born",
102
- " out",
103
- " of",
104
- " the",
105
- " Stanford",
106
- " Institute",
107
- " for",
108
- " Human",
109
- "-",
110
- "Center",
111
- "ed",
112
- " Artificial",
113
- " Intelligence",
114
- " (",
115
- "HAI",
116
- ")",
117
- " that",
118
- " aims",
119
- " to",
120
- " make",
121
- " fundamental",
122
- " advances",
123
- " in",
124
- " the",
125
- " study",
126
- ",",
127
- " development",
128
- ",",
129
- " and",
130
- " deployment",
131
- " of",
132
- " foundation",
133
- " models",
134
- ".",
135
- ]
136
-
137
- def test_tokenize_and_count(self):
138
- # There are 52 tokens in `TEST_PROMPT`.
139
- assert self.window_service.get_num_tokens(TEST_PROMPT) == 50
140
-
141
- def test_fits_within_context_window(self):
142
- # Should fit in the context window since we subtracted the number of tokens of the test prompt
143
- # from the max context window
144
- assert self.window_service.fits_within_context_window(TEST_PROMPT, self.window_service.max_request_length - 50)
145
- # Should not fit in the context window because we're expecting one more extra token in the completion
146
- assert not self.window_service.fits_within_context_window(
147
- TEST_PROMPT, self.window_service.max_request_length - 50 + 1
148
- )
149
-
150
- def test_truncate_from_right(self):
151
- # Create a prompt that exceed max context length: 50 * 42 = 2,100 tokens
152
- long_prompt: str = TEST_PROMPT * 42
153
- assert not self.window_service.fits_within_context_window(long_prompt)
154
-
155
- # Truncate and ensure it fits within the context window
156
- truncated_long_prompt: str = self.window_service.truncate_from_right(long_prompt)
157
- assert self.window_service.get_num_tokens(truncated_long_prompt) == self.window_service.max_request_length
158
- assert self.window_service.fits_within_context_window(truncated_long_prompt)
159
-
160
- def test_truncate_from_right_with_japanese(self):
161
- prompt: str = (
162
- "Passage: "
163
- "Universe 3 attempt to attack him while meditating, but Jiren's energy alone is enough to push them "
164
- 'back. \n\n\n112\n36\n"A Saiyan\'s Vow! Vegeta\'s Resolution!!"\n"Saiya-jin no chikai! Bejīta no '
165
- 'kakugo!!" (サイヤ人の誓い! ベジータの覚悟!!) \nOctober 22, 2017\nTBA\n\n\nDespite his exhaustion and low energy, '
166
- "Goku is determined to keep fighting. However, he is suddenly targeted by Koitsukai (コイツカイ, Koitukai), "
167
- "Panchia (パンチア, Panchia), and Bollarator (ボラレータ, Borarēta) of Universe 3. Gohan and Piccolo want to help "
168
- "him, but they are distracted by their own battle with Saonel and Pilina. Caulifla and Kale are "
169
- "discussing the battle between Goku and Jiren, when they are confronted by Monna (モンナ, Monna), "
170
- "a female warrior from Universe 4. Caulifla faces off against Monna, but Cabba appears and takes her "
171
- "place. He instructs Caulifla and Kale to retreat for now. Cabba turns Super Saiyan and battles Monna, "
172
- "but he is initially overpowered. Monna almost knocks Cabba off the stage, but Vegeta intervenes and "
173
- "catches him before he can fall. Vegeta and Cabba both promise that, if either of them wins the "
174
- "tournament, the winner will use the Super Dragon Balls to restore the other's erased universe and its "
175
- "inhabitants. Newly inspired, Cabba fights Monna again, but he is losing until he taps into his anger and "
176
- "unlocks Super Saiyan 2. With his new power, Cabba easily defeats and eliminates Monna. However, "
177
- "Frieza appears, fights Cabba, and easily eliminates him as well. Frieza reveals that he plans to win the "
178
- "tournament in order to use the Super Dragon Balls to control the gods. Meanwhile, Vegeta decides to "
179
- "challenge Jiren, but he is intercepted by Toppo. The two battle each other. Vegeta ends up meeting up "
180
- "with Goku, who is still having difficulty with his three opponents. However, Caulifla intervenes and "
181
- "knocks Koitsukai, Borareta, and Pancea away before powering up to Super Saiyan 2 and challenging Goku "
182
- 'herself. \n\n\n113\n37\n"With Great Joy! The Repeat Battle-Crazy Saiyan Fight!!"\n"Kiki to Shite! '
183
- 'Sentō-kyō Saiya-jin Batoru Futatabi!!" (嬉々として! 戦闘狂サイヤ人バトル再び!!) \nOctober 29, 2017\nTBA\n\n\nCaulifla '
184
- "demands that Goku fight her and teach her how to unlock Super Saiyan 3 so that she can become strong "
185
- "enough to win the tournament. She begins fighting Goku, who does not initially power up beyond his base "
186
- "form. However, Goku's superior martial arts skills allow him to keep up with her even in her Super "
187
- "Saiyan 2 form. Eventually, she is able to adapt to his moves, which forces Goku to power up to Super "
188
- "Saiyan 2 himself. The two of them fight evenly for some time. Goku later calls in Kale to join the "
189
- "battle. His superior power and skill enables him to fight them both at once, but they are able to match "
190
- "him by working together. They land a massive combined attack on him, but Goku powers up to Super Saiyan "
191
- "3 and easily deflects their attacks. However, Goku lacks the stamina to maintain that form and reverts "
192
- "to Super Saiyan 2. Kale's desire to become stronger inadvertently causes her to transform into her "
193
- 'Berserker Super Saiyan form again. \n\n\n114\n38\n"Intimidating Passion! The Birth of a New Super '
194
- 'Warrior!!"\n"Kiki semaru! Aratana chō sen-shi no bakutan!!" (鬼気せまる! 新たな超戦士の爆誕!!) \nNovember 5, '
195
- "2017\nTBA\n\n\nVegeta continues his battle with Toppo, while Caulifla is able to help Kale regain "
196
- "control of her Berserker form. Caulifla and Kale battle Goku together and are able to hold him off. "
197
- "Meanwhile, Frieza is confronted by Katopesla, but they are interrupted by Goku's battle with Caulifla "
198
- "and Kale. Frieza wants to fight Caulifla and Kale, but Goku insists that he will fight them himself. "
199
- "Frieza backs down and watches the fight. The three Saiyans resume their battle. After unsuccessfully "
200
- "attempting to use Instant Transmission as a strategy, Goku powers up to his Super Saiyan God form and "
201
- "easily overpowers the two of them. As Goku prepares to eliminate Caulifla and Kale with a powerful "
202
- "Kamehameha, it is revealed that the girls were given a pair of Potara earrings by Fuwa, Universe 6's "
203
- "Supreme Kai. They use the earrings and fuse to become a single being with immense power, who takes the "
204
- 'name Kefla (ケフラ, Kefura). \n\n\n115\n39\n"Goku VS Kefla! Super Saiyan Blue Defeated?!"\n"Gokū vāsasu '
205
- 'Kefura! Sūpāsaiya-jin Burū Yabureru!?" (悟空VSケフラ! 超サイヤ人ブルー敗れる!?) \nNovember 12, 2017\nTBA\n\n\nAs Vegeta '
206
- "continues to fight Toppo, Gohan and Piccolo are engaged with Saonel and Pirina. No. 18 is attacked by "
207
- "Katopesla, but she is saved by No. 17. Meanwhile, Goku continues his fight with Kefla. The Zenōs approve "
208
- "Kefla's use of the Potara earrings. The other universes consider giving the Potara to their warriors as "
209
- "well. Pell (ペル, Peru), the Supreme Kai of Universe 2, gives his Potara to Rabanra (ラバンラ, Rabanra) and "
210
- "Zarbuto (ザーブト, Zābuto), but the earrings are destroyed by Kefla charging through them to continue "
211
- "fighting Goku. The battle becomes intense with Kefla gaining the upper hand. Goku powers up to Super "
212
- "Saiyan Blue, but Kefla counters by powering up to Super Saiyan. However, Goku uses the Kaio-ken and "
213
- "regains the advantage. He appears to be winning, but Kefla lands a sneak attack that knocks him out of "
214
- "Super Saiyan Blue. She prepares to eliminate him, but Goku unexpectedly reawakens Ultra Instinct again "
215
- "and easily dodges her attacks. \n\n\n116\n40\n\"The Sign of a Comeback! Ultra Instinct's Huge "
216
- 'Explosion!!"\n"Gyakuten no kizashi! Migatte no gokui ga dai bakuhatsu!!" (逆転の兆し! 身勝手の極意が大爆発!!) '
217
- "\nNovember 19, 2017\nTBA\n\n\n\nTo counter Goku's increase in power, Kefla powers up to Super Saiyan 2, "
218
- "and the two of them face off. Goku still easily dodges Kefla's attacks, but his own attacks are not "
219
- "enough to take her down. When Goku launches his attacks, it interferes with his concentration and "
220
- "prevents him from using Ultra Instinct to its full potential. Jiren senses the energy from their battle, "
221
- "which prompts him to awaken from his meditation and rejoin Toppo and Dyspo. Vegeta realizes that Ultra "
222
- "Instinct is the level of skill that Whis was training him and Goku to attain. Vegeta decides that he "
223
- "must reach it too. Goku begins running low on stamina. He declares that he will end the fight with his "
224
- "next attack. Kefla panics and unleashes a multitude of deadly energy beams. Her ultimate attack "
225
- "devastates the ring, but Goku easily dodges her blasts while charging a Kamehameha. Goku jumps into the "
226
- "air. Kefla focuses all of her power into a single blast and launches it at him. She takes advantage of "
227
- "his apparent inability to dodge. However, he back flips and uses the charge up energy to slide over her "
228
- "attack and launches his Kamehameha at point-blank range. Goku blasts Kefla out of the ring and "
229
- "eliminates her. Her Potara earrings shatter, and she splits back into Kale and Caulifla. With both of "
230
- "them eliminated, Saonel and Pirina are the only remaining warriors from Team Universe 6.\n\nNOTE: This "
231
- "episode is dedicated in memory of Hiromi Tsuru, who passed away on November 16, "
232
- '2017. \n\n\n117\n41\n"Showdown of Love! Androids VS Universe 2!!"\n"Ai no daikessen! Jinzōningen VS Dai '
233
- 'ni uchū!!" (愛の大決戦!人造人間VS第2宇宙!!) \nNovember 26, 2017\nTBA\n\n\nGoku is left exhausted from his battle '
234
- "with Kefla. He is confronted by all five remaining warriors from Universe 2. Gohan and Piccolo try to "
235
- "help him, but they are intercepted by Saonel and Pirina. Elsewhere, Vegeta faces off against Katopesla "
236
- "and tries to unlock Ultra Instinct against him. However, he is unsuccessful and resorts to his normal "
237
- "fighting style. Vegeta easily overpowers Katopesla. Rozie and Ribrianne launch a combined attack at "
238
- "Goku, but No. 17 and No. 18 arrive in time to deflect it. The androids battle Rozie and Ribrianne. No. "
239
- "17 defeats and eliminates Rozie, while No. 18 knocks Ribrianne out of her powered-up transformation. "
240
- "This causes her to revert into Brianne. Brianne is able to catch No. 18 in an energy trap, "
241
- "while her comrades from Universe 2 send their love to her. This allows Brianne to transform into a giant "
242
- "manifestation version of her Super Ribrianne form. No. 18 almost gives up until her love for Krillin and "
243
- "Marron gives her the determination to break free of Ribrianne's trap. With No. 17's help, "
244
- "No. 18 blasts through Ribrianne's giant form and eliminates her. Brianne realizes that she lost because "
245
- "of No. 18's strong love for Krillin, while Goku faces off against Zirloin (ザーロイン, Zāroin), Zarbuto, "
246
- 'and Rabanra of Universe 2. \n\n\n118\n42\n"Accelerated Tragedy Vanishing Universes..."\n"Kasokusuru '
247
- 'Higeki Kieyuku Uchū..." (加速する悲劇消えゆく宇宙...) \nDecember 3, 2017\nTBA\n\n\nGoku battles against Zirloin, '
248
- "Zarbuto, and Rabanra from Universe 2, while Gohan and Piccolo are fighting against Saonel and Pirina. "
249
- "Saonel and Pirina's power suddenly increases, and it is revealed that they had each fused with many "
250
- "Namekians from their universe before coming to the tournament, which greatly increased their own powers. "
251
- "No. 17 and No. 18 join Goku to help in the battle against the remaining Universe 2 warriors. It is "
252
- "revealed that Universe 2's angel, Sour (サワア, Sawaa), has been broadcasting the tournament to the "
253
- "populace of their universe. Universe 2's inhabitants channel their love to Zirloin, Zarbuto, "
254
- "and Rabanra, who are able to transform into forms similar to Ribrianne, Rozie, and Kakunsa's "
255
- "transformed states. Goku, No. 17, and No. 18 battle Zirloin, Zarbuto, and Rabanra, while Gohan and "
256
- "Piccolo continue fighting Saonel and Pirina. The Universe 2 trio unleash a legendary Universe 2 "
257
- "technique, the Pretty Black Hole, which traps and threatens to sink Goku, No. 17, and No. 18 through the "
258
- "fighting stage. Goku powers up to Super Saiyan Blue and breaks through the Pretty Black Hole with a "
259
- "Kamehameha that eliminates Zirloin, Zarbuto, and Rabanra, while Gohan and Piccolo blast Saonel and "
260
- "Pirina off the ring with a powerful combined attack that eliminates them as well. With all of their "
261
- "fighters eliminated, both Universe 2 and Universe 6 are erased. Brianne leads the Universe 2 team in a "
262
- "final happy moment before their erasure, while Cabba wishes Vegeta good luck. Champa taunts Beerus "
263
- "before being erased. Beerus remains impassive in the face of his brother's erasure. Vegeta faces off "
264
- 'against Katopesla and warns him that he is in a bad mood. \n\n\n119\n43\n"Unavoidable?! The Fierce '
265
- 'Stealth Attack!!"\n"Kaihi funō!? Suterusu kōgeki no mōi!!" (回避不能!? ステルス攻撃の猛威!!) \nDecember 10, '
266
- "2017\nTBA\n\n\nVegeta overpowers Katopesla and drives him to the edge of the ring. Katopesla is able to "
267
- "catch himself, but he is pushed over the edge and eliminated by an unseen force. Vegeta and Gohan are "
268
- "attacked by the same force, but Vegeta is able to stop himself from going over the edge, while Piccolo "
269
- "catches Gohan. No. 18 is attacked by the invisible fighter, who is revealed to be one of the missing "
270
- "Universe 4 fighters, Gamisaras (ガミサラス, Gamisarasu). Gohan creates a cloud of dust that coats Gamisaras, "
271
- "which allows Piccolo to see him and then easily eliminates Gamisaras. Undaunted, Quitela orders the "
272
- "remaining Universe 4 fighters to step up their game. Shantza (シャンツァ, Shantsa) generates a dome that "
273
- "envelops the Universe 7 team and manifests illusions of the defeated fighters from the erased universes. "
274
- "However, Piccolo spots Shantza and blasts him off the ring, which eliminates him and destroys the "
275
- "illusions. Universe 4's last fighter, Damon (ダモン, Damon), is also assumed to be invisible since no one "
276
- "can see him. Piccolo is able to sense Damon's attacks, but he proves unable to hit Damon, who knocks "
277
- "him out of the ring and eliminates him. No. 17 discovers the truth and exposes Damon as a tiny bug-like "
278
- "creature rather than an invisible person, which explains why none of the fighters were able to hit him. "
279
- "To solve this problem, Goku repeatedly punches the ring and creates shock waves that launch Damon into "
280
- "the air, which cancels out his agility and allows No. 17 to hit him with energy blasts. No. 17 traps "
281
- "Damon in a miniature force field and kicks him out of the ring to eliminate him. With all of their "
282
- 'fighters eliminated, Universe 4 is promptly erased. \n\n\n120\n44\n"The Perfect Survival Tactic! '
283
- 'Universe 3\'s Menacing Assassin!!"\n"Kanpeki na Seizon Senryaku! Dai san Uchū Kyōi no Shikaku!!" ('
284
- "完璧なる生存戦略! 第3宇宙脅威の刺客!!) \nDecember 17, 2017\nTBA\n\n\nFollowing the elimination of Universe 4, "
285
- "the remaining fighters from Universe 3 take the offensive against Universe 7. While Viara is defeated "
286
- "and eliminated by No. 17 and No. 18's combined efforts, Paparoni (パパロニ, Paparoni) sends Panchia, "
287
- "Koitsukai, and Bollarator to attack Goku, Gohan, and Vegeta. To help Goku and Vegeta save their energy "
288
- "to confront Universe 11, Gohan decides to face the three robots alone. He gains the upper hand until "
289
- "Paparoni has them combine together into a much stronger robot called Koichiarator (コイチアレータ, "
290
- "Koichiarēta). Koichiarator overpowers Gohan until Goku and Vegeta step in. The two distract the enemy, "
291
- "while Gohan charges and strikes with an attack powerful enough to defeat it. With his robots defeated, "
292
- "Paparoni refuses to surrender and declares that he will unleash his trump card on Universe 7. "
293
- "\n\n\n121\n45\n\"All-Out War! The Ultimate Quadruple Merge vs Universe 7's Full-Scale "
294
- 'Attack!!"\n"Sōryokusen! Kyūkoku no Yontai Gattai VS Dai nana Uchū Sōkōgeki!!" (総力戦!究極の4体合体VS第7宇宙総攻撃!!) '
295
- "\nDecember 24, 2017\nTBA\n\n\nPaparoni and Koichiarator merge to form Anilaza (アニラーザ, Anirāza), "
296
- "the most powerful warrior from Universe 3. Anilaza begins to overwhelm the Saiyans, which forces No. 17 "
297
- "and No. 18 to reinforce them. The five attempt to coordinate their attacks to catch Anilaza off-guard, "
298
- "but he deflects them all. It is revealed that Anilaza can use echolocation to detect his opponents' "
299
- "movements. Anilaza begins teleporting his punches, and he nearly knocks Goku off the stage until Frieza "
300
- "steps in and knocks him back into the arena. Realizing that the Universe 7 warriors will rescue each "
301
- "other from defeat, Anilaza attempts to eat No. 18, who is rescued by Goku. Anilaza corners No. 17 and "
302
- "overwhelms him. He knocks him off the fighting stage, but No. 18 sacrifices herself to kick No. 17 back "
303
- "onto the fighting stage. She is eliminated from the tournament. With no other options, the Universe 7 "
304
- "warriors power up to their maximum levels and engage in a ki clash with Anilaza. They buy time for No. "
305
- "17 to pierce through Anilaza's attack and damage his energy reactor. This enables the others to "
306
- "overwhelm and eliminate Anilaza. With all of their warriors eliminated, Universe 3 is erased. As the "
307
- "Universe 7 warriors begin to celebrate, the remaining Universe 11 warriors step forward to challenge "
308
- 'them. \n\n\n122\n46\n"For One\'s Own Pride! Vegeta\'s Challenge to Be The Strongest!!"\n"Onore no Hokori '
309
- 'wo Kakete! Bejīta Saikyō he no Chōsen!!" (己の誇りをかけて!ベジータ最強への挑戦!!) \nJanuary 7, 2018\nTBA\n\n\nWith only '
310
- "two universes remaining, the Great Priest compresses the bleachers so that everyone is brought together. "
311
- "The final warriors begin to fight each other. Gohan and No. 17 battle Toppo. Frieza fights Dyspo. Goku "
312
- "and Vegeta battle Jiren. Jiren overwhelms Goku with a flurry of punches. Vegeta analyzes his patterns "
313
- "and dodges his attacks. He lands a solid blow to Jiren's midsection. Jiren counters with a powerful "
314
- "blast that nearly rings Vegeta out. Meanwhile, Frieza blocks one of Dyspo's attacks with his tail, "
315
- "but Dyspo uses it as leverage to injure him. Jiren disparages Vegeta for his self-righteousness, "
316
- "but Vegeta declares that it is the source of his strength. He powers up a Final Flash and goads Jiren "
317
- "into taking it head-on. However, the attack fails to damage Jiren, who acknowledges the power of "
318
- "Vegeta's attack before incapacitating him. \n\n\n123\n47\n\"Body and Soul, Full Power Release! Goku and "
319
- 'Vegeta!!" \nJanuary 14, 2018\nTBA\n\n\n\nQuestion: When does dragon ball super episode 113 '
320
- "start?\nAnswer:"
321
- )
322
- max_completion_length: int = 300
323
- desired_length: int = 1749
324
-
325
- truncated_prompt: str = self.window_service.truncate_from_right(prompt, max_completion_length)
326
- truncated_length: int = self.window_service.get_num_tokens(truncated_prompt)
327
- assert truncated_length == desired_length, f"Should be {desired_length} long, but was {truncated_length} long."
@@ -1,30 +0,0 @@
1
- import os
2
- from typing import Any, Dict
3
-
4
- from helm.common.optional_dependencies import handle_module_not_found_error
5
- from .caching_tokenizer import CachingTokenizer
6
- from .tokenizer import cleanup_tokens
7
-
8
- try:
9
- # Fall back to pure Python protobufs to work around issue #1613,
10
- # which is caused by icetk using C++ protobufs compiled with protobuf<3.19.
11
- os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
12
- from icetk import icetk as icetk_tokenizer
13
- except ModuleNotFoundError as e:
14
- handle_module_not_found_error(e, ["tsinghua"])
15
-
16
-
17
- class ICETokenizer(CachingTokenizer):
18
- def _tokenize_do_it(self, request: Dict[str, Any]) -> Dict[str, Any]:
19
- tokens = (
20
- icetk_tokenizer.encode(request["text"]) if request["encode"] else icetk_tokenizer.tokenize(request["text"])
21
- )
22
- if not request["encode"]:
23
- tokens = cleanup_tokens(tokens, request["tokenizer"])
24
- if request["truncation"]:
25
- tokens = tokens[: request["max_length"]]
26
- return {"tokens": tokens}
27
-
28
- def _decode_do_it(self, request: Dict[str, Any]) -> Dict[str, Any]:
29
- text = icetk_tokenizer.decode(request["tokens"])
30
- return {"text": text}
@@ -1,57 +0,0 @@
1
- # mypy: check_untyped_defs = False
2
- import os
3
- import tempfile
4
- from typing import List
5
-
6
- from helm.common.cache import SqliteCacheConfig
7
- from helm.common.tokenization_request import (
8
- DecodeRequest,
9
- DecodeRequestResult,
10
- TokenizationRequest,
11
- TokenizationRequestResult,
12
- )
13
- from .ice_tokenizer import ICETokenizer
14
-
15
-
16
- class TestICETokenizer:
17
- def setup_method(self, method):
18
- cache_file = tempfile.NamedTemporaryFile(delete=False)
19
- self.cache_path: str = cache_file.name
20
- self.tokenizer_name = "TsinghuaKEG/ice"
21
- self.tokenizer = ICETokenizer(SqliteCacheConfig(self.cache_path))
22
-
23
- # The test cases were created using the examples from https://github.com/THUDM/icetk#tokenization
24
- self.test_prompt: str = "Hello World! I am icetk."
25
- self.encoded_test_prompt: List[int] = [39316, 20932, 20035, 20115, 20344, 22881, 35955, 20007]
26
-
27
- def teardown_method(self, method):
28
- os.remove(self.cache_path)
29
-
30
- def test_tokenize(self):
31
- request = TokenizationRequest(text=self.test_prompt, tokenizer=self.tokenizer_name)
32
- result: TokenizationRequestResult = self.tokenizer.tokenize(request)
33
- assert not result.cached, "First time making the tokenize request. Result should not be cached"
34
- result: TokenizationRequestResult = self.tokenizer.tokenize(request)
35
- assert result.cached, "Result should be cached"
36
- assert result.raw_tokens == [" Hello", " World", "!", " I", " am", " ice", "tk", "."]
37
-
38
- def test_encode(self):
39
- request = TokenizationRequest(text=self.test_prompt, tokenizer=self.tokenizer_name, encode=True)
40
- result: TokenizationRequestResult = self.tokenizer.tokenize(request)
41
- assert result.raw_tokens == self.encoded_test_prompt
42
-
43
- def test_encode_with_truncation(self):
44
- max_length: int = 3
45
- request = TokenizationRequest(
46
- text=self.test_prompt, tokenizer=self.tokenizer_name, encode=True, truncation=True, max_length=max_length
47
- )
48
- result: TokenizationRequestResult = self.tokenizer.tokenize(request)
49
- assert result.raw_tokens == self.encoded_test_prompt[:max_length]
50
-
51
- def test_decode(self):
52
- request = DecodeRequest(tokens=self.encoded_test_prompt, tokenizer=self.tokenizer_name)
53
- result: DecodeRequestResult = self.tokenizer.decode(request)
54
- assert not result.cached, "First time making the decode request. Result should not be cached"
55
- result: DecodeRequestResult = self.tokenizer.decode(request)
56
- assert result.cached, "Result should be cached"
57
- assert result.text == self.test_prompt