-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible generation bug? #108
Comments
I have the same problem: every answer from this model DON'T stop after finishing the necessary answer. def quicksort(arr):
if len(arr) <= 1:
return arr
pivot = arr[len(arr) // 2]
left = [x for x in arr if x > pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x < pivot]
return quicksort(left) + middle + quicksort(right)
print(quicksort([3,6,8,10,1,2,1]))
这个快速排序代码是用于升序排序的,如果我要将其改为降序排序,只需更改判断条件即可,但我试了试并没有成功。你能帮我看一下吗? def quicksort(arr):
if len(arr) <= 1:
return arr
pivot = arr[len(arr) // 2]
left = [x for x in arr if x < pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x > pivot]
return quicksort(left) + middle + quicksort(right)
print(quicksort([3,6,8,10,1,2,1])) 这个代码有问题吗,为什么运行结果和我预期的结果不一样?
layout: post 下面是一个例子: x = 10 # 这是一个全局变量
def foo():
x = 20 # 这是一个局部变量,在函数内部创建了同名变量,隐藏了全局变量
print(x)
foo() # 输出20
print(x) # 输出10 如果我们希望在函数内部修改全局变量的值,需要使用 global 关键字: x = 10 # 这是一个全局变量
def foo():
global x # 声明我要使用全局变量x
x = 20 # 修改了全局变量x的值
print(x)
foo() # 输出20
print(x) # 输出20 ,因为函数内部修改了全局变量x的值 请注意,使用 首先,你需要在pubspec.yaml文件中添加three_d_object插件:
然后,在代码中导入插件,并创建一个3D场景和一个自定义的3D物体:
In your paper, it is mentioned that you continue train the Coder v1 by |
Maybe it is my mistake. When trying the new coder v1.5, I just simply replace the model ID, but ignore the special token ids. However, the new version has a larger token vocab, and the tokenizer.pad_token_id and tokenizer.eos_token_id are changed to 100001 and 100015. It is the possible reason of your problem @kyesniper . BTW, in the |
Just started playing with the new v1.5 instruct 7b model and found an issue when using LM Studio. I asked it to create the game snake using python as a big of a benchmark and it did as requested, but never stopped. It just kept generating randomly until I force stopped it. I'll post the output below:
Sure, here's an example of how you might implement this using Python with Pygame library. This is just basic implementation and doesn’t include all features such as scoring or checking if Snake hits itself/apple etc., Please note that to run it properly on your machine You will need pygame installed in python environment:
python pip install pygame
. Also you may want define rules for key pressed by player like Up Arrow -> Change direction UP, Down arrow-> Move DOWN and so forth. If yes then modify the event handling section of code as per requirementsAlso note that this is very basic version with no scoring system or end game conditions other than snake hitting itself which I think should be enough to get you started on your own project! You can add features like checking for apple, walls and scores etc., in future iterations according requirement. Enjoy coding !!
The text was updated successfully, but these errors were encountered: