| build_params_map |
Ran ran on a synthesized input |
LaiXinyi823/emotect/src/convert.py code served (permissive licence) · get_code("8844bed4da5fe428") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned OrderedDict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import collections
def build_params_map(attention_num=12):
"""
build params map from paddle-paddle's ERNIE to transformer's ernie
"""
weight_map = collections.OrderedDict({'word_embedding': 'ernie.ernie.ernie_embedding_lookup.embedding_table', 'pos_embedding': 'ernie.ernie.ernie_embedding_postprocessor.full_position_embedding.embedding_table', 'sent_embedding': 'ernie.ernie.ernie_embedding_postprocessor.token_type_embedding.embedding_table', 'pre_encoder_layer_norm_scale': 'ernie.ernie.ernie_embedding_postprocessor.layernorm.gamma', 'pre_encoder_layer_norm_bias': 'ernie.ernie.ernie_embedding_postprocessor.layernorm.beta'})
for i in range(attention_num):
weight_map[f'encoder_layer_{i}_multi_head_att_query_fc.w_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.attention.query_layer.weight'
weight_map[f'encoder_layer_{i}_multi_head_att_query_fc.b_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.attention.query_layer.bias'
weight_map[f'encoder_layer_{i}_multi_head_att_key_fc.w_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.attention.key_layer.weight'
weight_map[f'encoder_layer_{i}_multi_head_att_key_fc.b_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.attention.key_layer.bias'
weight_map[f'encoder_layer_{i}_multi_head_att_value_fc.w_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.attention.value_layer.weight'
weight_map[f'encoder_layer_{i}_multi_head_att_value_fc.b_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.attention.value_layer.bias'
weight_map[f'encoder_layer_{i}_multi_head_att_output_fc.w_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.output.dense.weight'
weight_map[f'encoder_layer_{i}_multi_head_att_output_fc.b_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.output.dense.bias'
weight_map[f'encoder_layer_{i}_post_att_layer_norm_scale'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.output.layernorm.gamma'
weight_map[f'encoder_layer_{i}_post_att_layer_norm_bias'] = f'ernie.ernie.ernie_encoder.layers.{i}.attention.output.layernorm.beta'
weight_map[f'encoder_layer_{i}_ffn_fc_0.w_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.intermediate.weight'
weight_map[f'encoder_layer_{i}_ffn_fc_0.b_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.intermediate.bias'
weight_map[f'encoder_layer_{i}_ffn_fc_1.w_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.output.dense.weight'
weight_map[f'encoder_layer_{i}_ffn_fc_1.b_0'] = f'ernie.ernie.ernie_encoder.layers.{i}.output.dense.bias'
weight_map[f'encoder_layer_{i}_post_ffn_layer_norm_scale'] = f'ernie.ernie.ernie_encoder.layers.{i}.output.layernorm.gamma'
weight_map[f'encoder_layer_{i}_post_ffn_layer_norm_bias'] = f'ernie.ernie.ernie_encoder.layers.{i}.output.layernorm.beta'
weight_map.update({'pooled_fc.w_0': 'ernie.ernie.dense.weight', 'pooled_fc.b_0': 'ernie.ernie.dense.bias', 'cls_out_w': 'ernie.dense_1.weight', 'cls_out_b': 'ernie.dense_1.bias'})
return weight_map
ARGS = {
'attention_num': 12
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| build_params_map |
Ran ran on a synthesized input |
nghuyong/ERNIE-Pytorch/convert_ernie_gram.py code served (permissive licence) · get_code("7b2aeabe0e46a532") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned OrderedDict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import collections
def build_params_map(attention_num=12):
"""
build params map from paddle-paddle's ERNIE to transformer's BERT
:return:
"""
weight_map = collections.OrderedDict({'ernie_gram.embeddings.word_embeddings.weight': 'ernie.embeddings.word_embeddings.weight', 'ernie_gram.embeddings.position_embeddings.weight': 'ernie.embeddings.position_embeddings.weight', 'ernie_gram.embeddings.token_type_embeddings.weight': 'ernie.embeddings.token_type_embeddings.weight', 'ernie_gram.embeddings.task_type_embeddings.weight': 'ernie.embeddings.task_type_embeddings.weight', 'ernie_gram.embeddings.layer_norm.weight': 'ernie.embeddings.LayerNorm.gamma', 'ernie_gram.embeddings.layer_norm.bias': 'ernie.embeddings.LayerNorm.beta'})
for i in range(attention_num):
weight_map[f'ernie_gram.encoder.layers.{i}.self_attn.q_proj.weight'] = f'ernie.encoder.layer.{i}.attention.self.query.weight'
weight_map[f'ernie_gram.encoder.layers.{i}.self_attn.q_proj.bias'] = f'ernie.encoder.layer.{i}.attention.self.query.bias'
weight_map[f'ernie_gram.encoder.layers.{i}.self_attn.k_proj.weight'] = f'ernie.encoder.layer.{i}.attention.self.key.weight'
weight_map[f'ernie_gram.encoder.layers.{i}.self_attn.k_proj.bias'] = f'ernie.encoder.layer.{i}.attention.self.key.bias'
weight_map[f'ernie_gram.encoder.layers.{i}.self_attn.v_proj.weight'] = f'ernie.encoder.layer.{i}.attention.self.value.weight'
weight_map[f'ernie_gram.encoder.layers.{i}.self_attn.v_proj.bias'] = f'ernie.encoder.layer.{i}.attention.self.value.bias'
weight_map[f'ernie_gram.encoder.layers.{i}.self_attn.out_proj.weight'] = f'ernie.encoder.layer.{i}.attention.output.dense.weight'
weight_map[f'ernie_gram.encoder.layers.{i}.self_attn.out_proj.bias'] = f'ernie.encoder.layer.{i}.attention.output.dense.bias'
weight_map[f'ernie_gram.encoder.layers.{i}.norm1.weight'] = f'ernie.encoder.layer.{i}.attention.output.LayerNorm.gamma'
weight_map[f'ernie_gram.encoder.layers.{i}.norm1.bias'] = f'ernie.encoder.layer.{i}.attention.output.LayerNorm.beta'
weight_map[f'ernie_gram.encoder.layers.{i}.linear1.weight'] = f'ernie.encoder.layer.{i}.intermediate.dense.weight'
weight_map[f'ernie_gram.encoder.layers.{i}.linear1.bias'] = f'ernie.encoder.layer.{i}.intermediate.dense.bias'
weight_map[f'ernie_gram.encoder.layers.{i}.linear2.weight'] = f'ernie.encoder.layer.{i}.output.dense.weight'
weight_map[f'ernie_gram.encoder.layers.{i}.linear2.bias'] = f'ernie.encoder.layer.{i}.output.dense.bias'
weight_map[f'ernie_gram.encoder.layers.{i}.norm2.weight'] = f'ernie.encoder.layer.{i}.output.LayerNorm.gamma'
weight_map[f'ernie_gram.encoder.layers.{i}.norm2.bias'] = f'ernie.encoder.layer.{i}.output.LayerNorm.beta'
weight_map.update({'ernie_gram.pooler.dense.weight': 'ernie.pooler.dense.weight', 'ernie_gram.pooler.dense.bias': 'ernie.pooler.dense.bias'})
return weight_map
ARGS = {
'attention_num': 12
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| build_params_map |
Ran ran on a synthesized input |
nghuyong/ERNIE-Pytorch/convert_ernie_health.py code served (permissive licence) · get_code("c08862d5ef3ecb1c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned OrderedDict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import collections
def build_params_map(attention_num=12):
"""
build params map from paddle-paddle's ERNIE to transformer's BERT
:return:
"""
weight_map = collections.OrderedDict({'electra.embeddings.word_embeddings.weight': 'ernie.embeddings.word_embeddings.weight', 'electra.embeddings.position_embeddings.weight': 'ernie.embeddings.position_embeddings.weight', 'electra.embeddings.token_type_embeddings.weight': 'ernie.embeddings.token_type_embeddings.weight', 'electra.embeddings.task_type_embeddings.weight': 'ernie.embeddings.task_type_embeddings.weight', 'electra.embeddings.layer_norm.weight': 'ernie.embeddings.LayerNorm.gamma', 'electra.embeddings.layer_norm.bias': 'ernie.embeddings.LayerNorm.beta'})
for i in range(attention_num):
weight_map[f'electra.encoder.layers.{i}.self_attn.q_proj.weight'] = f'ernie.encoder.layer.{i}.attention.self.query.weight'
weight_map[f'electra.encoder.layers.{i}.self_attn.q_proj.bias'] = f'ernie.encoder.layer.{i}.attention.self.query.bias'
weight_map[f'electra.encoder.layers.{i}.self_attn.k_proj.weight'] = f'ernie.encoder.layer.{i}.attention.self.key.weight'
weight_map[f'electra.encoder.layers.{i}.self_attn.k_proj.bias'] = f'ernie.encoder.layer.{i}.attention.self.key.bias'
weight_map[f'electra.encoder.layers.{i}.self_attn.v_proj.weight'] = f'ernie.encoder.layer.{i}.attention.self.value.weight'
weight_map[f'electra.encoder.layers.{i}.self_attn.v_proj.bias'] = f'ernie.encoder.layer.{i}.attention.self.value.bias'
weight_map[f'electra.encoder.layers.{i}.self_attn.out_proj.weight'] = f'ernie.encoder.layer.{i}.attention.output.dense.weight'
weight_map[f'electra.encoder.layers.{i}.self_attn.out_proj.bias'] = f'ernie.encoder.layer.{i}.attention.output.dense.bias'
weight_map[f'electra.encoder.layers.{i}.norm1.weight'] = f'ernie.encoder.layer.{i}.attention.output.LayerNorm.gamma'
weight_map[f'electra.encoder.layers.{i}.norm1.bias'] = f'ernie.encoder.layer.{i}.attention.output.LayerNorm.beta'
weight_map[f'electra.encoder.layers.{i}.linear1.weight'] = f'ernie.encoder.layer.{i}.intermediate.dense.weight'
weight_map[f'electra.encoder.layers.{i}.linear1.bias'] = f'ernie.encoder.layer.{i}.intermediate.dense.bias'
weight_map[f'electra.encoder.layers.{i}.linear2.weight'] = f'ernie.encoder.layer.{i}.output.dense.weight'
weight_map[f'electra.encoder.layers.{i}.linear2.bias'] = f'ernie.encoder.layer.{i}.output.dense.bias'
weight_map[f'electra.encoder.layers.{i}.norm2.weight'] = f'ernie.encoder.layer.{i}.output.LayerNorm.gamma'
weight_map[f'electra.encoder.layers.{i}.norm2.bias'] = f'ernie.encoder.layer.{i}.output.LayerNorm.beta'
return weight_map
ARGS = {
'attention_num': 12
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| build_params_map |
Ran ran on a synthesized input |
nghuyong/ERNIE-Pytorch/convert.py code served (permissive licence) · get_code("f8c635671e91bc15") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned OrderedDict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import collections
# The function build_params_map takes only one parameter: attention_num
# It's an integer that controls how many attention layers to map
# The function builds and returns an OrderedDict, it doesn't use the parameter
# to do anything complex - just loops through range(attention_num)
ARGS = {
'attention_num': 12
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| convert_to_unicode |
Ran ran on a synthesized input |
lyqcom/emotect/src/reader.py code served (permissive licence) · get_code("01f2dd1d4afbd7c9") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import six
# The function convert_to_unicode takes a single parameter 'text'
# It handles string/bytes conversion based on Python version
# We need to provide valid text inputs
# Test with a string (the most common case)
ARGS = {
'text': 'hello world'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- six — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| csv_reader |
Ran ran on a synthesized input |
lyqcom/emotect/src/reader.py code served (permissive licence) · get_code("2d616c30587d4003") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned generator. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import io
# Create a file-like object (fd parameter) with sample CSV data
csv_data = "col1\tcol2\tcol3\nvalue1\tvalue2\tvalue3\nvalue4\tvalue5\tvalue6\nsinglevalue\n"
fd = io.StringIO(csv_data)
# Define arguments for csv_reader
ARGS = {
'fd': fd,
'delimiter': '\t'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| calc_lm_head_logits |
Not yet run unverified (harvested, no recorded run) |
PaddlePaddle/ERNIE/ernie/modeling.py code served (permissive licence) · get_code("f277229b3bab1f59") How it ran |