Buckets:

rtrm's picture
|
download
raw
24.1 kB
# အခန်း (၉) ဆိုင်ရာ မေးခွန်းများ[[end-of-chapter-quiz]]
<CourseFloatingBanner
chapter={9}
classNames="absolute z-10 right-0 top-0"
/>
ဒီအခန်းမှာ သင်ယူခဲ့တာတွေကို စစ်ဆေးကြည့်ရအောင်။
### ၁။ 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 ှာ <code>share=True</code> 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 Facemodel hub ို့မဟHugging Face Spaces model တစကို load ်း။",
explain: "တယ်။ <code>gr.Interface.load()</code> 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 တစကို ထည့််းါ။ ၎်းသညinterfacestate ကို ကိုားြုတယ်။",
explain: "သင့် interfacehistory ို့မဟstate ကို ်းဆည်းော အပို parameter တစိုအပတယ်။",
correct: true
},
{
text: "prediction functionအဆုံး်၊ stateupdated 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 ွေထည့်ို့ <code>with gradio.Tabs():</code> ကို အသုံးပြုနိုင်ပါတယ်။",
correct: true
},
{
text: "event triggers တွေ (ဥပမာ- clicked/changed/etc) ကို <code>Blocks</code> components တွေဆီ သတ်မှတ်နိုင်ပါတယ်။",
explain: "event တစ်ခုကို သတ်မှတ်တဲ့အခါ၊ သင် parameters သုံးခုကို ပေးရပါတယ်- fn: ခေါ်ဆိုသင့်တဲ့ function၊ inputs: input component(s) list (list) နဲ့ outputs: ခေါ်ဆိုသင့်တဲ့ output component(s) list (list) တို့ ဖြစ်ပါတယ်။",
correct: true
},
{
text: "မည်သည့် <code>Blocks</code> component ကို interactive သို့မဟုတ် static ဖြစ်သင့်သည်ကို အလိုအလျောက် ဆုံးဖြတ်ပေးပါတယ်။",
explain: "သင်သတ်မှတ်ထားတဲ့ event triggers တွေပေါ်မူတည်ပြီး <code>Blocks</code> က 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: "<code>Interface</code> လိုပဲ <code>Blocks</code> demos တွေအတွက် sharing နဲ့ hosting capabilities တွေအားလုံး အတူတူပါပဲ!",
correct: true
},
{
text: "မှားသည်။",
explain: "<code>Interface</code> လိုပဲ <code>Blocks</code> 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 များ။
<EditOnGithub source="https://github.com/huggingface/course/blob/main/chapters/my/chapter9/9.mdx" />

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.