Buckets:

rtrm's picture
|
download
raw
24.1 kB

အခန်း (၉) ဆိုင်ရာ မေးခွန်းများ[[end-of-chapter-quiz]]

ဒီအခန်းမှာ သင်ယူခဲ့တာတွေကို စစ်ဆေးကြည့်ရအောင်။

၁။ Gradio ကို အသုံးပြုပြီး ဘာတွေ လုပ်နိုင်သလဲ။

<Question choices={[ { text: "သင့်ရဲ့ machine learning model အတွက် demo တစ်ခု ဖန်တီးနိုင်ပါတယ်။", explain: "Python code လိုင်းအနည်းငယ်နဲ့ ကျွန်တော်တို့ရဲ့ pre-built components library ကို အသုံးပြုပြီး သင့် ML model အတွက် demo တစ်ခုကို ဖန်တီးနိုင်ပါတယ်။", correct: true }, { text: "သင့်ရဲ့ machine learning model ကို တခြားသူတွေနဲ့ မျှဝေနိုင်ပါတယ်။", explain: "launch method မှာ share=True parameter ကို အသုံးပြုပြီး ဘယ်သူ့ကိုမဆို ပေးပို့နိုင်တဲ့ share link တစ်ခုကို ဖန်တီးနိုင်ပါတယ်။", correct: true }, { text: "သင့် model ကို debug လုပ်နိုင်ပါတယ်။", explain: "Gradio demo ရဲ့ အားသာချက်တစ်ခုက သင့် model ကို real data နဲ့ စမ်းသပ်နိုင်ပြီး သင် data ကို ပြောင်းလဲတဲ့အခါ model ရဲ့ predictions တွေ real time မှာ ဘယ်လိုပြောင်းလဲသွားလဲဆိုတာကို လေ့လာနိုင်တာကြောင့် သင့် model ကို debug လုပ်ဖို့ အကူအညီဖြစ်စေပါတယ်။", correct: true }, { text: "သင့် model ကို train နိုင်ပါတယ်။", explain: "Gradio ကို model inference အတွက် ဒီဇိုင်းထုတ်ထားတာပါ၊ သင့် model ကို train ပြီးမှ အသုံးပြုဖို့ပါ။", } ]} />

၂။ Gradio သည် PyTorch models များနှင့်သာ အလုပ်လုပ်သည်။

<Question choices={[ { text: "မှန်သည်။", explain: "Gradio သည် PyTorch models များနှင့် အလုပ်လုပ်သော်လည်း မည်သည့် machine learning model အမျိုးအစားအတွက်မဆို အလုပ်လုပ်ပါတယ်။" }, { text: "မှားသည်။", explain: "Gradio သည် model agnostic ဖြစ်သည်၊ ဆိုလိုသည်မှာ မည်သည့် machine learning model အမျိုးအစားအတွက်မဆို demo တစ်ခုကို ဖန်တီးနိုင်ပါတယ်။", correct: true } ]} />

၃။ Gradio demo ကို ဘယ်ကနေ launch လုပ်နိုင်သလဲ။

<Question choices={[ { text: "Standard python IDEs များမှ။", explain: "Gradio သည် သင်အကြိုက်ဆုံး IDEs များဖြင့် ကောင်းစွာ အလုပ်လုပ်ပါတယ်။", correct: true }, { text: "Google Colab notebooks များမှ။", explain: "သင့် Google colab notebook ထဲမှာ demo တစ်ခုကို ဖန်တီးပြီး launch လုပ်နိုင်ပါတယ်။", correct: true }, { text: "Jupyter notebooks များမှ။", explain: "မှန်ပါတယ်။ သင့် Jupyter notebook ထဲမှာ demo တစ်ခုကို ဖန်တီးပြီး launch လုပ်နိုင်ပါတယ်။", correct: true } ]} />

၄။ Gradio ကို အဓိကအားဖြင့် NLP models များအတွက် ဒီဇိုင်းထုတ်ထားသည်။

<Question choices={[ { text: "မှန်သည်။", explain: "Gradio သည် NLP အပြင် မည်သည့် data type နှင့်မဆို ကောင်းစွာ အလုပ်လုပ်ပါတယ်။" }, { text: "မှားသည်။", explain: "Gradio သည် developers များအတွက် မည်သည့် data type အတွက်မဆို pre-built components library ကို ပံ့ပိုးပေးပါတယ်။", correct: true } ]} />

၅။ အောက်ပါ features များထဲမှ မည်သည့်အရာများကို Gradio မှ ထောက်ပံ့ပေးသလဲ။

<Question choices={[ { text: "Multiple inputs နှင့် outputs။", explain: "Multiple inputs နှင့် outputs များသည် Gradio ဖြင့် ဖြစ်နိုင်ပါတယ်။ inputs နှင့် outputs များကို သက်ဆိုင်ရာ parameters များသို့ list အဖြစ် ပေးရုံသာ လိုအပ်ပါတယ်။", correct: true }, { text: "Data persistance အတွက် State။", explain: "Gradio သည် သင့် interface တွင် state ကို ထည့်သွင်းနိုင်စွမ်းရှိပါတယ်။", correct: true }, { text: "Username နှင့် password authentication။", explain: "authentication ထည့်ရန်အတွက် launch method သို့ username/password tuples list တစ်ခုကို ထည့်ပါ။", correct: true }, { text: "သင့် gradio demo ကို အသုံးပြုသူများအတွက် အလိုအလျောက် analytics များ။", explain: "ထပ်ကြိုးစားကြည့်ပါ — Gradio သည် developers များအား ၎င်းတို့၏ demos များကို မည်သူက အသုံးပြုသည်ကို analytics များ ပံ့ပိုးပေးခြင်း မရှိပါ။" }, { text: "Hugging Face ၏ model hub သို့မဟုတ် Hugging Face Spaces မှ model တစ်ခုကို load လုပ်ခြင်း။", explain: "မှန်ပါတယ်။ gr.Interface.load() method ကို အသုံးပြုပြီး မည်သည့် Hugging Face model ကိုမဆို load လုပ်နိုင်ပါတယ်။", correct: true } ]} />

၆။ Hugging Face Hub သို့မဟုတ် Spaces မှ Hugging Face model တစ်ခုကို load လုပ်ရန် မည်သည့်နည်းလမ်းများသည် မှန်ကန်သလဲ။

<Question choices={[ { text: "gr.Interface.load('huggingface/{user}/{model_name}')", explain: "ဒါဟာ Hub မှ Hugging Face model တစ်ခုကို load လုပ်ရန် မှန်ကန်သော နည်းလမ်းဖြစ်ပါတယ်။", correct: true }, { text: "gr.Interface.load('model/{user}/{model_name}')", explain: "ဒါဟာ Hub မှ Hugging Face model တစ်ခုကို load လုပ်ရန် မှန်ကန်သော နည်းလမ်းဖြစ်ပါတယ်။", correct: true }, { text: "gr.Interface.load('demos/{user}/{model_name}')", explain: "ထပ်ကြိုးစားကြည့်ပါ — 'demos' prefix ကို အသုံးပြုပြီး model ကို load လုပ်၍ မရပါ။" }, { text: "gr.Interface.load('spaces/{user}/{model_name}')", explain: "ဒါဟာ Spaces မှ Hugging Face model တစ်ခုကို load လုပ်ရန် မှန်ကန်သော နည်းလမ်းဖြစ်ပါတယ်။", correct: true } ]} />

၇။ သင့် Gradio interface တွင် state ကို ထည့်သွင်းရန် လိုအပ်သော အဆင့်များအားလုံးကို ရွေးချယ်ပါ။

<Question choices={[ { text: "သင့် prediction function ထဲသို့ အပို parameter တစ်ခုကို ထည့်သွင်းပါ။ ၎င်းသည် interface ၏ state ကို ကိုယ်စားပြုပါတယ်။", explain: "သင့် interface ၏ history သို့မဟုတ် state ကို သိမ်းဆည်းသော အပို parameter တစ်ခု လိုအပ်ပါတယ်။", correct: true }, { text: "prediction function ၏ အဆုံးတွင်၊ state ၏ updated value ကို အပို return value အဖြစ် ပြန်ပေးပါ။", explain: "ဒီ history သို့မဟုတ် state value ကို သင့် function ကနေ ပြန်ပေးဖို့ လိုအပ်ပါတယ်။", correct: true }, { text: "Interface ကို ဖန်တီးတဲ့အခါ state input နှင့် state output components များကို ထည့်ပါ။", explain: "Gradio သည် data များကို ထိန်းသိမ်းရန် state input နှင့် output component များကို ပံ့ပိုးပေးပါတယ်။", correct: true } ]} />

၈။ အောက်ပါတို့မှ မည်သည့် components များသည် Gradio library တွင် ပါဝင်သလဲ။

<Question choices={[ { text: "Textbox။", explain: "ဟုတ်ပါတယ်။ Textbox component နဲ့ textboxes တွေ ဖန်တီးနိုင်ပါတယ်။", correct: true }, { text: "Graph။", explain: "လက်ရှိမှာ Graph component မရှိသေးပါဘူး။", }, { text: "Image။", explain: "ဟုတ်ပါတယ်။ Image component နဲ့ image upload widget တစ်ခု ဖန်တီးနိုင်ပါတယ်။", correct: true }, { text: "Audio။", explain: "ဟုတ်ပါတယ်။ Audio component နဲ့ audio upload widget တစ်ခု ဖန်တီးနိုင်ပါတယ်။", correct: true }, ]} />

၉။ Gradio Blocks က သင့်ကို ဘာလုပ်ခွင့်ပြုသလဲ။

<Question choices={[ { text: "multiple demos တွေကို web app တစ်ခုတည်းအဖြစ် ပေါင်းစပ်နိုင်ပါတယ်။", explain: "multiple demos တွေအတွက် tabs တွေထည့်ဖို့ with gradio.Tabs(): ကို အသုံးပြုနိုင်ပါတယ်။", correct: true }, { text: "event triggers တွေ (ဥပမာ- clicked/changed/etc) ကို Blocks components တွေဆီ သတ်မှတ်နိုင်ပါတယ်။", explain: "event တစ်ခုကို သတ်မှတ်တဲ့အခါ၊ သင် parameters သုံးခုကို ပေးရပါတယ်- fn: ခေါ်ဆိုသင့်တဲ့ function၊ inputs: input component(s) list (list) နဲ့ outputs: ခေါ်ဆိုသင့်တဲ့ output component(s) list (list) တို့ ဖြစ်ပါတယ်။", correct: true }, { text: "မည်သည့် Blocks component ကို interactive သို့မဟုတ် static ဖြစ်သင့်သည်ကို အလိုအလျောက် ဆုံးဖြတ်ပေးပါတယ်။", explain: "သင်သတ်မှတ်ထားတဲ့ event triggers တွေပေါ်မူတည်ပြီး Blocks က component တစ်ခုက user input ကို လက်ခံသင့်လား မလက်ခံသင့်ဘူးလားဆိုတာကို အလိုအလျောက် ဆုံးဖြတ်ပါတယ်။", correct: true }, { text: "multi-step demos တွေ ဖန်တီးနိုင်ပါတယ်။ ဆိုလိုတာက component တစ်ခုရဲ့ output ကို နောက်တစ်ခုရဲ့ input အဖြစ် ပြန်လည်အသုံးပြုနိုင်ပါတယ်။", explain: "component တစ်ခုကို event trigger တစ်ခုရဲ့ input အတွက် အသုံးပြုနိုင်ပေမယ့် နောက်တစ်ခုရဲ့ output အတွက်လည်း အသုံးပြုနိုင်ပါတယ်။", correct: true }, ]} />

၁၀။ Blocks demo တစ်ခုကို public link တစ်ခု မျှဝေနိုင်ပြီး Hugging Face spaces မှာ Blocks demo တစ်ခုကို host လုပ်နိုင်ပါတယ်။

<Question choices={[ { text: "မှန်သည်။", explain: "Interface လိုပဲ Blocks demos တွေအတွက် sharing နဲ့ hosting capabilities တွေအားလုံး အတူတူပါပဲ!", correct: true }, { text: "မှားသည်။", explain: "Interface လိုပဲ Blocks demos တွေအတွက် sharing နဲ့ hosting capabilities တွေအားလုံး အတူတူပါပဲ!", correct: false } ]} />

ဝေါဟာရ ရှင်းလင်းချက် (Glossary)

  • Gradio: Python library တစ်ခုဖြစ်ပြီး machine learning မော်ဒယ်တွေအတွက် အသုံးပြုရလွယ်ကူတဲ့ web interface တွေ ဒါမှမဟုတ် demo တွေကို အလွယ်တကူ ဖန်တီးနိုင်စေပါတယ်။
  • Machine Learning Model: Artificial Intelligence (AI) နယ်ပယ်တွင် အချက်အလက်များကို လေ့လာပြီး ခန့်မှန်းချက်များ ပြုလုပ်ရန် ဒီဇိုင်းထုတ်ထားသော သင်္ချာဆိုင်ရာဖွဲ့စည်းပုံများ။
  • Demo: Machine Learning model များ၏ စွမ်းဆောင်ရည်ကို တိုက်ရိုက်ပြသနိုင်သော interactive application များ။
  • Pre-built Components: Gradio library မှ ကြိုတင်ထောက်ပံ့ပေးထားသော UI components များ။
  • share=True Parameter: launch() method တွင် Gradio Interface အတွက် public, shareable link တစ်ခုကို ဖန်တီးရန် သတ်မှတ်သည်။
  • launch() Method: Gradio Interface ကို web server တစ်ခုအဖြစ် စတင်လုပ်ဆောင်သည်။
  • Debug: ကွန်ပျူတာပရိုဂရမ်တစ်ခုရှိ အမှားများ (bugs) ကို ရှာဖွေ၊ ဖော်ထုတ်ပြီး ပြင်ဆင်ခြင်း။
  • Model Inference: လေ့ကျင့်ပြီးသား Artificial Intelligence (AI) မော်ဒယ်တစ်ခုကို အသုံးပြုပြီး input data ကနေ ခန့်မှန်းချက်တွေ ဒါမှမဟုတ် output တွေကို ထုတ်လုပ်တဲ့ လုပ်ငန်းစဉ်။
  • Model Agnostic: မည်သည့် model အမျိုးအစား သို့မဟုတ် framework ကိုမဆို ထောက်ပံ့ပေးနိုင်သော သို့မဟုတ် ၎င်းတို့ပေါ်တွင် မမူတည်သော သဘောတရား။
  • PyTorch Models: PyTorch framework ဖြင့် တည်ဆောက်ထားသော Machine Learning model များ။
  • Python IDEs (Integrated Development Environments): Python code များရေးရန်၊ debug လုပ်ရန်နှင့် run ရန်အတွက် ပရိုဂရမ်မာများ အသုံးပြုသော ဆော့ဖ်ဝဲလ် application များ။
  • Google Colab Notebooks: Google မှ ပံ့ပိုးပေးထားသော cloud-based Jupyter Notebook environment တစ်ခု။
  • Jupyter Notebooks: code, text, images, နှင့် mathematical equations တို့ကို ပေါင်းစပ်နိုင်သော interactive computing environment။
  • NLP Models (Natural Language Processing Models): လူသားဘာသာစကားကို နားလည်၊ အဓိပ္ပာယ်ဖော်ပြီး၊ ဖန်တီးနိုင်အောင် ဒီဇိုင်းထုတ်ထားသော models များ။
  • Multiple Inputs and Outputs: Gradio interface တစ်ခုတွင် inputs (သို့မဟုတ် outputs) တစ်ခုထက်ပို၍ ရှိနေခြင်း။
  • State: Gradio interface အတွင်းရှိ ဒေတာများကို session တစ်ခုအတွင်း ထိန်းသိမ်းထားနိုင်သော သဘောတရား။ (ဥပမာ- chat history)။
  • Data Persistence: ဒေတာများကို program run ပြီးနောက်에도 ဆက်လက်တည်ရှိနေစေရန် သိမ်းဆည်းထားနိုင်ခြင်း။
  • Username and Passwords Authentication: အသုံးပြုသူအမည်နှင့် စကားဝှက်များကို အသုံးပြု၍ အသုံးပြုသူ၏ မည်သူမည်ဝါဖြစ်ကြောင်း အတည်ပြုခြင်း။
  • Hugging Face's Model Hub: AI မော်ဒယ်တွေ၊ datasets တွေနဲ့ demo တွေကို အခြားသူတွေနဲ့ မျှဝေဖို့၊ ရှာဖွေဖို့နဲ့ ပြန်လည်အသုံးပြုဖို့အတွက် အွန်လိုင်း platform တစ်ခု ဖြစ်ပါတယ်။
  • Hugging Face Spaces: Hugging Face Hub ၏ အစိတ်အပိုင်းတစ်ခုဖြစ်ပြီး Gradio ကဲ့သို့သော library များကို အသုံးပြု၍ Machine Learning demos များကို host လုပ်ပြီး မျှဝေနိုင်သည်။
  • gr.Interface.load() Method: Gradio ၏ Interface class မှ method တစ်ခုဖြစ်ပြီး Hugging Face Hub မှ models များ သို့မဟုတ် Spaces များကို တိုက်ရိုက် load လုပ်ရန် အသုံးပြုသည်။
  • huggingface/{user}/{model_name}: Hugging Face Hub မှ model တစ်ခုကို load လုပ်ရန်အတွက် URL format။
  • model/{user}/{model_name}: Hugging Face Hub မှ model တစ်ခုကို load လုပ်ရန်အတွက် အခြား URL format။
  • spaces/{user}/{model_name}: Hugging Face Spaces မှ demo တစ်ခုကို load လုပ်ရန်အတွက် URL format။
  • Prediction Function: Gradio Interface မှ wrap လုပ်ထားသော Python function ဖြစ်ပြီး input ကိုယူကာ output ကို ပြန်ပေးသည်။
  • Textbox: Gradio ၏ input component တစ်မျိုးဖြစ်ပြီး အသုံးပြုသူအား စာသားများ ရိုက်ထည့်ရန် ခွင့်ပြုသည်။
  • Image: Gradio ၏ input component တစ်မျိုးဖြစ်ပြီး အသုံးပြုသူအား ပုံရိပ်များ upload လုပ်ရန် ခွင့်ပြုသည်။
  • Audio: Gradio ၏ input component တစ်မျိုးဖြစ်ပြီး အသုံးပြုသူအား အသံဖိုင်များ upload လုပ်ရန် သို့မဟုတ် microphone မှ မှတ်တမ်းတင်ရန် ခွင့်ပြုသည်။
  • Blocks: Gradio ၏ အဆင့်မြင့် features တစ်ခုဖြစ်ပြီး demos များကို ပိုမိုစိတ်ကြိုက်ပြင်ဆင်နိုင်သော layout များဖြင့် တည်ဆောက်ရန်၊ multiple demos များကို ပေါင်းစပ်ရန်နှင့် event-driven interactions များကို ဖန်တီးရန် ခွင့်ပြုသည်။
  • gradio.Tabs(): Gradio Blocks တွင် multiple demos များကို tab များအဖြစ် ပိုင်းခြားပြသရန် အသုံးပြုသည်။
  • Event Triggers: အသုံးပြုသူ၏ လုပ်ဆောင်ချက်များ (ဥပမာ- click, change) သို့မဟုတ် အခြား event များ ဖြစ်ပေါ်လာသည့်အခါ code ကို လုပ်ဆောင်စေသော အရာများ။
  • fn Parameter (for event triggers): event trigger ဖြစ်ပေါ်လာသည့်အခါ ခေါ်ဆိုရမည့် function။
  • inputs Parameter (for event triggers): function သို့ input အဖြစ် ပေးပို့ရမည့် components များ။
  • outputs Parameter (for event triggers): function ၏ ရလဒ်များကို ပြသရန် update လုပ်ရမည့် components များ။
  • Interactive Components: အသုံးပြုသူများက တိုက်ရိုက်ထိတွေ့၊ ပြောင်းလဲနိုင်သော UI elements များ။
  • Static Components: အသုံးပြုသူ၏ input ကို လက်ခံခြင်းမရှိဘဲ သတင်းအချက်အလက်များကိုသာ ပြသသော UI elements များ။
  • Multi-step Demos: အသုံးပြုသူ၏ အဆင့်အမျိုးမျိုးကို ဖြတ်သန်းပြီး နောက်အဆင့်သို့ ဆက်သွားနိုင်သော demos များ။

Xet Storage Details

Size:
24.1 kB
·
Xet hash:
c0ab044e41d6e21bf210c2ca6b24080115fa68f50fef86ebae0faeec940899be

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.