topshik commited on
Commit
919a794
·
verified ·
1 Parent(s): a4eec8e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -9
README.md CHANGED
@@ -219,18 +219,23 @@ print("### Prediction")
219
  print(tokenizer.decode(out[0][input_len:]))
220
  ```
221
 
222
- ## Fill in the middle generation
223
  ```python
224
- prefix = """
225
- def fibonacci(n: int) -> int:
226
- """
 
 
 
 
 
227
 
228
- suffix = """
229
- if __name__ == "__main__":
230
- print(fibonacci(10))
231
- """
232
 
233
- encoded_input = tokenizer(f"<fim_suffix>{suffix}<fim_prefix>{prefix}<fim_middle>", return_tensors='pt', return_token_type_ids=False)
234
  out = model.generate(
235
  **encoded_input,
236
  max_new_tokens=100,
 
219
  print(tokenizer.decode(out[0][input_len:]))
220
  ```
221
 
222
+ ## Fill in the middle with additional files as context generation
223
  ```python
224
+ example = """<filename>utils.py
225
+ def multiply(x, y):
226
+ return x * y
227
+ <filename>config.py
228
+ DEBUG = True
229
+ MAX_VALUE = 100
230
+ <filename>example.py
231
+ <fim_suffix>
232
 
233
+ # Test the function
234
+ result = calculate_sum(5, 10)
235
+ print(result)<fim_prefix>def calculate_sum(a, b):
236
+ <fim_middle>"""
237
 
238
+ encoded_input = tokenizer(example, return_tensors='pt', return_token_type_ids=False)
239
  out = model.generate(
240
  **encoded_input,
241
  max_new_tokens=100,