Skip to content

Commit

Permalink
Merge pull request #62 from QwenLM/cyente-patch-17
Browse files Browse the repository at this point in the history
Update CodeQwen1.5-base-repolevel-fim.py
  • Loading branch information
huybery committed May 11, 2024
2 parents 5c8ceb1 + 5acafa6 commit 16c662a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/CodeQwen1.5-base-repolevel-fim.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# tokenize the input into tokens
# set fim format into the corresponding file you need to infilling
input_text = """<reponame>library-system
input_text = """<repo_name>library-system
<file_sep>library.py
class Book:
def __init__(self, title, author, isbn, copies):
Expand Down Expand Up @@ -97,7 +97,7 @@ def main():
# The generated_ids include prompt_ids, so we only need to decode the tokens after prompt_ids.
output_text = tokenizer.decode(generated_ids[len(model_inputs.input_ids[0]):], skip_special_tokens=True)

print(f"Prompt: \n{input_text}\n\nGenerated text: \n{output_text}")
print(f"Prompt: \n{input_text}\n\nGenerated text: \n{output_text.split('<file_sep>')[0]}")

# the expected output as following:
"""
Expand Down

0 comments on commit 16c662a

Please sign in to comment.