From 9f38763731178290a3a4b8a8c9999ffb9b6bd120 Mon Sep 17 00:00:00 2001 From: Ahn Joon Sung Date: Wed, 30 Jul 2025 00:04:30 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20[i18n-KO]=20Translated=20`pipeli?= =?UTF-8?q?ne=5Fgradio.md`=20to=20Korean=20(#39520)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: ko: pipeline_gradio.md * feat: nmt draft * fix: manual edits * docs: ko: pipeline_gradio.md --- docs/source/ko/_toctree.yml | 4 +-- docs/source/ko/pipeline_gradio.md | 52 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 docs/source/ko/pipeline_gradio.md diff --git a/docs/source/ko/_toctree.yml b/docs/source/ko/_toctree.yml index 99f7ea8da8..19a08c300e 100644 --- a/docs/source/ko/_toctree.yml +++ b/docs/source/ko/_toctree.yml @@ -50,8 +50,8 @@ - sections: - local: pipeline_tutorial title: Pipeline으로 추론하기 - - local: in_translation - title: (번역중) Machine learning apps + - local: pipeline_gradio + title: 머신러닝 앱 - local: pipeline_webserver title: 추론 웹 서버를 위한 파이프라인 - local: add_new_pipeline diff --git a/docs/source/ko/pipeline_gradio.md b/docs/source/ko/pipeline_gradio.md new file mode 100644 index 0000000000..418ebfa0fb --- /dev/null +++ b/docs/source/ko/pipeline_gradio.md @@ -0,0 +1,52 @@ + + +# 머신러닝 앱 [[machine-learning-apps]] + +머신러닝 앱을 빠르고 쉽게 구축하고 공유할 수 있는 라이브러리인 [Gradio](https://www.gradio.app/)는 [`Pipeline`]과 통합되어 추론을 위한 간단한 인터페이스를 빠르게 생성할 수 있습니다. + +시작하기 전에 Gradio가 설치되어 있는지 확인하세요. + +```py +!pip install gradio +``` + +원하는 작업에 맞는 pipeline을 생성한 다음, Gradio의 [Interface.from_pipeline](https://www.gradio.app/docs/gradio/interface#interface-from_pipeline) 함수에 전달하여 인터페이스를 만드세요. Gradio는 [`Pipeline`]에 맞는 입력 및 출력 컴포넌트를 자동으로 결정합니다. + +[launch](https://www.gradio.app/main/docs/gradio/blocks#blocks-launch)를 추가하여 웹 서버를 생성하고 앱을 시작하세요. + +```py +from transformers import pipeline +import gradio as gr + +pipeline = pipeline("image-classification", model="google/vit-base-patch16-224") +gr.Interface.from_pipeline(pipeline).launch() +``` + +웹 앱은 기본적으로 로컬 서버에서 실행됩니다. 다른 사용자와 앱을 공유하려면 [launch](https://www.gradio.app/main/docs/gradio/blocks#blocks-launch)에서 `share=True`로 설정하여 임시 공개 링크를 생성하세요. 더 지속적인 솔루션을 원한다면 Hugging Face [Spaces](https://hf.co/spaces)에서 앱을 호스팅하세요. + +```py +gr.Interface.from_pipeline(pipeline).launch(share=True) +``` + +아래 Space는 위 코드를 사용하여 생성되었으며, Spaces에서 호스팅됩니다. + +