Add `library_name: transformers` to metadata
#2
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
| 3 |
tags:
|
| 4 |
- dllm
|
| 5 |
- diffusion
|
| 6 |
- llm
|
| 7 |
- text_generation
|
| 8 |
-
|
| 9 |
---
|
| 10 |
|
| 11 |
# ReFusion
|
|
@@ -91,7 +92,7 @@ def generate_refusion(model, tokenizer, prompt, gen_length=128, temperature=0.,
|
|
| 91 |
cur_gen_pos_ids = gen_pos_ids[:, serial_num_block*block_length:(serial_num_block+1)*block_length] # (batch_size, block_length)
|
| 92 |
|
| 93 |
cur_gen_blocks_x = cur_gen_x.reshape(batch_size, -1, cur_slot_size)
|
| 94 |
-
cur_gen_blocks_pos_ids =
|
| 95 |
|
| 96 |
# slot level generation
|
| 97 |
while cur_gen_blocks_x.numel() > 0:
|
|
@@ -416,7 +417,15 @@ def main():
|
|
| 416 |
model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, torch_dtype=torch.bfloat16).to(device).eval()
|
| 417 |
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
| 418 |
|
| 419 |
-
prompt = "You are an expert Python programmer. Your task is to write a single Python function to solve the problem described below, and here is your task: Write a function to sum all amicable numbers from 1 to a specified number
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 420 |
|
| 421 |
m = [{"role": "user", "content": prompt}, ]
|
| 422 |
prompt = tokenizer.apply_chat_template(m, add_generation_prompt=True, tokenize=False, enable_thinking=True)
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
tags:
|
| 5 |
- dllm
|
| 6 |
- diffusion
|
| 7 |
- llm
|
| 8 |
- text_generation
|
| 9 |
+
library_name: transformers
|
| 10 |
---
|
| 11 |
|
| 12 |
# ReFusion
|
|
|
|
| 92 |
cur_gen_pos_ids = gen_pos_ids[:, serial_num_block*block_length:(serial_num_block+1)*block_length] # (batch_size, block_length)
|
| 93 |
|
| 94 |
cur_gen_blocks_x = cur_gen_x.reshape(batch_size, -1, cur_slot_size)
|
| 95 |
+
cur_gen_blocks_pos_ids = cur_gen_blocks_pos_ids.reshape(batch_size, -1, cur_slot_size)
|
| 96 |
|
| 97 |
# slot level generation
|
| 98 |
while cur_gen_blocks_x.numel() > 0:
|
|
|
|
| 417 |
model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, torch_dtype=torch.bfloat16).to(device).eval()
|
| 418 |
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
| 419 |
|
| 420 |
+
prompt = "You are an expert Python programmer. Your task is to write a single Python function to solve the problem described below, and here is your task: Write a function to sum all amicable numbers from 1 to a specified number.
|
| 421 |
+
|
| 422 |
+
Directly after the '[BEGIN]' marker, you must write only the Python code for the function. Do not provide any explanations, comments, or introductory text. The function must include the 'def' line, its arguments, the function body, and a 'return' statement. Your code should pass these tests:
|
| 423 |
+
|
| 424 |
+
assert amicable_numbers_sum(999)==504
|
| 425 |
+
assert amicable_numbers_sum(9999)==31626
|
| 426 |
+
assert amicable_numbers_sum(99)==0
|
| 427 |
+
[BEGIN]
|
| 428 |
+
"
|
| 429 |
|
| 430 |
m = [{"role": "user", "content": prompt}, ]
|
| 431 |
prompt = tokenizer.apply_chat_template(m, add_generation_prompt=True, tokenize=False, enable_thinking=True)
|