B00TK1D / copilot-api

GitHub Copilot API
MIT License
123 stars 21 forks source link

Getting one line of code only #6

Closed turinaf closed 2 months ago

turinaf commented 3 months ago

I removed the new line in 'stop': ['\n'], , but still getting only one line of code.

Example whan I prompt it to write a function to check if a number is odd or not, it only gives:

def odd_even(n):

What could the issue?

gamangandi commented 2 months ago

@turinaf try replacing that '\n' with some random string or try increasing max tokens.

NihalGIT commented 2 months ago

I removed the new line in 'stop': ['\n'], , but still getting only one line of code.

Example whan I prompt it to write a function to check if a number is odd or not, it only gives:

def odd_even(n):

What could the issue?

u should replace \n in stop with # and it's gonna work , good luck

B00TK1D commented 2 months ago

As per the last line of the readme, "In order to build a complete code snippet, iteratively append the generated code to the prompt and send it back to the API until the response is empty". That's the most effective way to generate large blocks of code - any other stop terminators may prematurely terminate if they appear natively in the output.

turinaf commented 2 months ago

Ok, thank you all.