Upgrade to Pro — share decks privately, control downloads, hide ads and more …

用 GPT3 打造小工具

Liang Bin Hsueh
December 22, 2022
26

用 GPT3 打造小工具

Liang Bin Hsueh

December 22, 2022
Tweet

Transcript

  1. ⽤GPT3打造⼩⼯

    薛良斌 / 布丁 / hlb
    https://hlb.im/

    View Slide

  2. 講者介紹
    薛良斌 / 布丁 / hlb

    InfuseAI 共同創辦⼈

    ⽣性懶惰,太⿇煩的事情
    都不想做,⽤程式⾃動化
    ⼈⽣

    投影片要有貓

    – https://hlb.im/

    View Slide

  3. 問對問題是⼀⾨藝術
    Source: Reddit: r/OpenAI

    View Slide

  4. 無⽤的⾖知識
    跟 ChatGPT 說 "Let's
    think step by step,"
    他就會變聰明喔
    Source:

    InstructGPT
    Paper
    其他各種問對問題的⽅式

    https://prompts.chat/

    View Slide

  5. 對於台灣教育,我
    的⼤膽預測
    ChatGPT,
    MidJourney, Stable
    Diffusion 都好夯啊,我
    家⼩孩剛上幼稚園,現在開
    始學習 prompt
    engineering 能不能贏
    在起跑點?

    View Slide

  6. prompt engineering
    有些⼈預測未來將有⼤量的提⽰⼯程職位。我確實
    相信⽂本提⽰將是告訴機器我們想要什麼的重要⽅
    式,毕竟它們是告訴其他⼈我們想要什麼的主要⽅
    式。但我認為提⽰⼯程只是問題的⼀⼩部分,對於
    專業提⽰⼯程師的崛起的狂熱預測缺乏⼤局觀。
    Andrew Ng, Oct 19, 2022,

    The Batch,
    Issue 167

    View Slide

  7. 本⽇分享
    範例都在
    ,可以⾃⼰拿去

    GitHub:hlb/openai-
    examples
    批次處理: Google
    Spreadsheet

    網⾴服務: 今晚吃什麼?

    網⾴服務: ⽤ AI 寫考
    績評語

    View Slide

  8. 批次處理
    Google Spreadsheet
    inspired by
    WARNING:
    twitter:shubroski

    View Slide

  9. function GPT3()
    =GPT3(
    prompt,
    temperature = 0.6, # 貪婪指數
    model = "text-davinci-003", # 模型引擎
    maxTokens = 256 # 最⼤ token 數量
    )

    View Slide

  10. View Slide

  11. View Slide

  12. function GPT3_RANGE()
    WARNING:
    =GPT3_RANGE(
    examples_input, # 範例輸入列表
    examples_output, # 範例輸出列表
    input, # 輸入
    temperature = 0.6, # 貪婪指數
    model = "text-davinci-003", # 模型引擎
    maxTokens = 256 # 最⼤ token 數量
    )

    View Slide

  13. View Slide

  14. View Slide

  15. 網⾴服務
    今晚吃什麼?
    叫 ChatGPT 寫推薦服務

    View Slide

  16. View Slide

  17. prompt: Use Streamlit to write a python app to get
    restaurant suggestions from OpenAI GPT3 "text-davinci-003"
    engine.

    View Slide

  18. Use Streamlit to write a python app to get restaurant
    suggestions from OpenAI GPT3 "text-davinci-003" engine.
    Just give me the code block. No explanation.

    View Slide

  19. tada!

    View Slide

  20. 網⾴服務
    ⽤ AI 寫考績評語
    https://review.gobudapest.io/

    View Slide

  21. View Slide

  22. View Slide

  23. Name: Dwight Schrute
    Job Title: Assistant to the Regional Manager
    Dwight Schrute is our Assistant to the Regional
    Manager and he has been evaluated on his
    performance. The score of the performance appraisal
    is 3/5.
    Dwight is a hardworking and dedicated employee who
    always puts in his best effort. He is quick on his
    feet and has the ability to think fast between a
    snake and a mongoose and a panther. He is always
    attentive and gives his undivided attention to his
    tasks. He is also very punctual and is usually five
    minutes ahead of schedule. He has a great sense of
    humor which helps to lighten the mood in the
    office.
    Dwight is a valuable asset to the company and has
    been a great help in achieving our goals. He is
    always willing to take on new challenges and is
    eager to learn new skills. He is also very
    organized and is able to complete tasks efficiently
    and effectively.
    Overall, Dwight is a great employee and has been a
    great asset to the company. He has shown dedication
    and commitment to his work and is always willing to
    go the extra mile. He has a great attitude and is
    always willing to help out his colleagues. He is a
    great team player and is always willing to lend a
    helping hand. He is an asset to the company and we
    are lucky to have him as part of the team.

    View Slide

  24. 5 of 5
    尊敬的魯夫船長,
    您在本次績效評估中獲得了5分的評價,表
    ⽰您的表現很出⾊。
    您每天都會舉辦宴會,⼤吃⼤喝,讓⼤家
    都能夠熱鬧地享受時光,更能夠增進⼤家
    之間的友誼。當⼤家⾯臨困境時,您也會
    挺⾝⽽出,為⼤家解決問題,讓⼤家都能
    夠安全地抵達⽬的地。
    您擁有豐富的經驗,能夠帶領⼤家安全地
    抵達⽬的地,⽽且您也會給予⼤家良好的
    指導,讓⼤家能夠更好地完成任務。您對
    ⼤家的友情也是非常重視,總是會給予⼤
    家正⾯的⿎勵,讓⼤家都能夠更加努⼒地
    完成任務。
    您是⼀位偉⼤的船長,您的表現讓⼤家都
    感到驕傲,您的毅⼒和決⼼讓⼤家都能夠
    更加堅定地完成任務。您對⼤家的⽀持和
    關懷,讓⼤家都能夠更加堅定地完成任
    務,讓⼤家都能夠安全地抵達⽬的地。
    再次感謝您,魯夫船長,您的表現讓⼤家
    都感到驕傲,您的毅⼒和決⼼讓⼤家都能
    夠更加堅定地完成任務。
    1 of 5
    尊敬的魯夫船長:
    您的表現評估得分為1/5,我們對您的表現
    表⽰深深的失望。
    您每天開宴會⼤吃⼤喝,這種⾏為不僅沒
    有為船隊帶來任何好處,反⽽損害了船隊
    的形象,給船隊帶來了負⾯影響。
    您重視友情,但您應該尊重船隊的規章制
    度,不應該因為友誼⽽忽視船隊的規定,
    ⽽且您應該更加重視船隊的利益,⽽不是
    個⼈的利益。
    在關鍵時刻,您應該挺⾝⽽出,為船隊出
    ⼀份⼒,⽽不是把責任推給其他⼈,您應
    該更加負責任,把船隊的利益放在⾸位,
    ⽽不是⾃⼰的利益。
    總⽽⾔之,您應該更加重視船隊的利益,
    把船隊的利益放在⾸位,⽽不是⾃⼰的利
    益,您應該更加負責任,在關鍵時刻挺⾝
    ⽽出,為船隊出⼀份⼒,⽽不是把責任推
    給其他⼈。
    希望您能夠改正⾃⼰的⾏為,為船隊帶來
    更多的正⾯影響,為船隊做出更多的貢
    獻!

    View Slide

  25. ⼯作不會消
    失,但是⼈
    類會變得更
    懶惰
    bonus:
    這份簡報是
    markdown
    ,然後你可以叫
    OpenAI
    幫你產⽣
    Markdown
    ,所以
    ......

    View Slide