V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
youthfire
V2EX  ›  OpenAI

code-davinci-002 模型的回答多少有点出乎意料

  •  
  •   youthfire · 2023-02-24 22:35:32 +08:00 · 1202 次点击
    这是一个创建于 432 天前的主题,其中的信息可能已经有所发展或是发生改变。
    最近在尝试 api 接口,一直用的是 text-davinci-003 模型,今天想试试看 code-davinci-002 ,一方面是因为政策上免费,一方面主要是个产生代码的专用接口。

    纯粹是想走通,看看能否产出代码。给他的 prompt 是 Please help me write a program using Python as the programming language, PySimpleGUI as the user interface. Click a button with the text "Press Me", and when you click, a pop-up message box will say "Hello".

    看看它能否快速给出代码,结果回答:"This is a very simple requirement, as long as you understand the most basic"

    这是迟早要造反呀 : D
    3 条回复    2023-02-25 16:25:35 +08:00
    TabGre
        1
    TabGre  
       2023-02-25 07:18:56 +08:00 via iPhone
    你们是走那么调用 chatgpt 接口的?
    lzghades
        2
    lzghades  
       2023-02-25 15:00:26 +08:00
    import PySimpleGUI as sg

    # Create a window
    layout = [ [sg.Text('Press Me')],
    [sg.Button('Press Me')] ]

    window = sg.Window('My Window', layout)

    # Event Loop to process "events" and get the "values" of the inputs
    while True:
    event, values = window.read()
    if event in (None, 'Exit'): # if user closes window or clicks cancel
    break
    elif event == 'Press Me':
    sg.popup('Hello!')

    window.close()


    这个是我的回复。。。你怕是调了个假接口。。
    youthfire
        3
    youthfire  
    OP
       2023-02-25 16:25:35 +08:00 via iPhone
    @lzghades #2 我也觉得是!在 playground 我看是正常的,接 api 就一顿乱回。是 prompt 要加#或者 /*之类的符号开始吗?我用的和 text 一样代码,只是换了 model_engine 而已。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2219 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:22 · PVG 10:22 · LAX 19:22 · JFK 22:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.