Gradio: Một thư viện xây dựng giao diện AI nhanh chóng, tương tác cao
Gradio: Thư viện xây dựng giao diện AI nhanh chóng, tương tác cao
🔹 1. Tại sao nên dùng Gradio?
🛠️ 2. Cách sử dụng cơ bản
import gradio as gr
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
def predict_sentiment(text):
return classifier(text)[0]['label']
demo = gr.Interface(fn=predict_sentiment,
inputs=gr.Textbox(lines=2, placeholder="Nhập câu của bạn..."),
outputs="label")
demo.launch()⚙️ 3. Các thành phần mạnh mẽ của Gradio
☁️ 4. Cách triển khai
💼 Ứng dụng thực tế
🔗 Gradio vs. Streamlit
Tính năng
Gradio
Streamlit
Last updated
