From d778ebe55190ddba9b3379b79393958bff5532d7 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Wed, 21 Aug 2024 00:17:36 +0900 Subject: [PATCH 1/3] docs: add Japanese README I created Japanese translated README. --- README.md | 2 +- readme_files/README_ja.md | 67 ++++++++++++++++++++++++++++++++++++ readme_files/README_zh-cn.md | 2 +- 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 readme_files/README_ja.md diff --git a/README.md b/README.md index b68f540..16b890d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gradio.NET: Build Machine Learning Web Apps — in .NET [![main](https://github.com/feiyun0112/Gradio.Net/actions/workflows/main.yml/badge.svg)](https://github.com/feiyun0112/Gradio.Net/actions/workflows/main.yml) [![NuGet](https://img.shields.io/nuget/v/Gradio.Net.svg)](https://nuget.org/packages/Gradio.Net) -**English** | **[简体中文](readme_files/README_zh-cn.md)** +**English** | **[简体中文](readme_files/README_zh-cn.md)** | **[日本語](readme_files/README_ja.md)** Gradio for .NET – a port of [Gradio](https://github.com/gradio-app/gradio), an open-source Python package that allows you to quickly **build** a demo or web application for your machine learning model, API, or any arbitrary Python function. *No JavaScript, CSS, or web hosting experience needed!* diff --git a/readme_files/README_ja.md b/readme_files/README_ja.md new file mode 100644 index 0000000..32cf736 --- /dev/null +++ b/readme_files/README_ja.md @@ -0,0 +1,67 @@ +# Gradio.NET: .NETで機械学習Webアプリを構築 [![main](https://github.com/feiyun0112/Gradio.Net/actions/workflows/main.yml/badge.svg)](https://github.com/feiyun0112/Gradio.Net/actions/workflows/main.yml) [![NuGet](https://img.shields.io/nuget/v/Gradio.Net.svg)](https://nuget.org/packages/Gradio.Net) + +**[English](../README.md)** | **[简体中文](readme_files/README_zh-cn.md)** + +Gradio for .NET – [Gradio](https://github.com/gradio-app/gradio) の .NET 移植版で、機械学習モデル、API、または任意のPython関数のデモやWebアプリケーションを迅速に**構築**するためのオープンソースのPythonパッケージです。*JavaScript、CSS、またはWebホスティングの経験は不要です!* + +![demo](readme_files/demo.gif) + +上記のような美しいデモを作成するには、ほんの数行の .NET コードが必要です。それでは始めましょう 💫 + +### 最初のデモを構築する + +- 1. ASP.NET Core Web API プロジェクトを作成します。 + +- 2. NuGet パッケージ **Gradio.Net.AspNetCore** をインストールします。 + +- 3. Program.cs にサンプルコードを入力します: + + +```C# +App.Launch(await CreateBlocks()); + +async Task CreateBlocks() +{ + using (var blocks = gr.Blocks()) + { + gr.Markdown("Start typing below and then click **Run** to see the output."); + Textbox input, output; + using (gr.Row()) + { + input = gr.Textbox(placeholder: "What is your name?"); + output = gr.Textbox(); + } + var btn = gr.Button("Run"); + await btn.Click(fn: async (input) => gr.Output($"Welcome to Gradio.Net, {Textbox.Payload(input.Data[0])}!"), inputs: new[] { input }, outputs: new[] { output }); + + return blocks; + } +} +``` + +これで完了です🎉🎉🎉 + +**既存のプロジェクトで **Gradio.Net.AspNetCore** を使用したい場合** + +`AddGradio` と `UseGradio` 拡張メソッドを使用できます: + +```C# +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddGradio(); + +var app = builder.Build(); + +app.UseGradio(await CreateBlocks()); + +app.Run(); +``` + +### デモ + +| ソースコード | デモ画像 | +| ----------- | ---------- | +| [レイアウト](./readme_files/layout_demo.md) | ![image](./readme_files/layout_demo.gif) | +| [フォーム](./readme_files/form_demo.md) | ![image](./readme_files/form_demo.gif) | +| [メディア](./readme_files/media_demo.md) | ![image](./readme_files/media_demo.gif) | +| [チャットボット](./readme_files/chatbot_demo.md) | ![image](./readme_files/chatbot_demo.gif) | +| [進行状況](./readme_files/progress_demo.md) | ![image](./readme_files/progress_demo.gif) | diff --git a/readme_files/README_zh-cn.md b/readme_files/README_zh-cn.md index c8da97a..5f9ae90 100644 --- a/readme_files/README_zh-cn.md +++ b/readme_files/README_zh-cn.md @@ -1,6 +1,6 @@ # Gradio.NET: 使用 .NET 生成机器学习 Web 应用 [![main](https://github.com/feiyun0112/Gradio.Net/actions/workflows/main.yml/badge.svg)](https://github.com/feiyun0112/Gradio.Net/actions/workflows/main.yml) [![NuGet](https://img.shields.io/nuget/v/Gradio.Net.svg)](https://nuget.org/packages/Gradio.Net) -**[English](../README.md)** | 简体中文 +**[English](../README.md)** | **[简体中文](readme_files/README_zh-cn.md)** | **[日本語](readme_files/README_ja.md)** Gradio for .NET – [Gradio](https://github.com/gradio-app/gradio) 的 .NET 移植,Gradio是一个开源 Python 包,允许您为机器学习模型、API 或任何任意 Python 函数快速构建演示或 Web 应用程序。*无需任何 JavaScript、CSS 经验!* From 507ce3ed7a47065fcdec5ff86c2142c7faba39bd Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Wed, 21 Aug 2024 00:18:54 +0900 Subject: [PATCH 2/3] docs: update README_ja.md --- readme_files/README_ja.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme_files/README_ja.md b/readme_files/README_ja.md index 32cf736..ffa12cc 100644 --- a/readme_files/README_ja.md +++ b/readme_files/README_ja.md @@ -1,6 +1,6 @@ # Gradio.NET: .NETで機械学習Webアプリを構築 [![main](https://github.com/feiyun0112/Gradio.Net/actions/workflows/main.yml/badge.svg)](https://github.com/feiyun0112/Gradio.Net/actions/workflows/main.yml) [![NuGet](https://img.shields.io/nuget/v/Gradio.Net.svg)](https://nuget.org/packages/Gradio.Net) -**[English](../README.md)** | **[简体中文](readme_files/README_zh-cn.md)** +**[English](../README.md)** | **[简体中文](readme_files/README_zh-cn.md)** | **日本語** Gradio for .NET – [Gradio](https://github.com/gradio-app/gradio) の .NET 移植版で、機械学習モデル、API、または任意のPython関数のデモやWebアプリケーションを迅速に**構築**するためのオープンソースのPythonパッケージです。*JavaScript、CSS、またはWebホスティングの経験は不要です!* From 43c5e459ea1ac0c6c9841ad624a0f955c67c511f Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Wed, 21 Aug 2024 00:21:05 +0900 Subject: [PATCH 3/3] docs: update README_ja.md --- readme_files/README_ja.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/readme_files/README_ja.md b/readme_files/README_ja.md index ffa12cc..ba0a829 100644 --- a/readme_files/README_ja.md +++ b/readme_files/README_ja.md @@ -4,7 +4,7 @@ Gradio for .NET – [Gradio](https://github.com/gradio-app/gradio) の .NET 移植版で、機械学習モデル、API、または任意のPython関数のデモやWebアプリケーションを迅速に**構築**するためのオープンソースのPythonパッケージです。*JavaScript、CSS、またはWebホスティングの経験は不要です!* -![demo](readme_files/demo.gif) +![demo](./demo.gif) 上記のような美しいデモを作成するには、ほんの数行の .NET コードが必要です。それでは始めましょう 💫 @@ -58,10 +58,10 @@ app.Run(); ### デモ -| ソースコード | デモ画像 | +| Source Code | Demo Image | | ----------- | ---------- | -| [レイアウト](./readme_files/layout_demo.md) | ![image](./readme_files/layout_demo.gif) | -| [フォーム](./readme_files/form_demo.md) | ![image](./readme_files/form_demo.gif) | -| [メディア](./readme_files/media_demo.md) | ![image](./readme_files/media_demo.gif) | -| [チャットボット](./readme_files/chatbot_demo.md) | ![image](./readme_files/chatbot_demo.gif) | -| [進行状況](./readme_files/progress_demo.md) | ![image](./readme_files/progress_demo.gif) | +| [Layout](./layout_demo.md) | ![image](./layout_demo.gif) | +| [Form](./form_demo.md) | ![image](./form_demo.gif) | +| [Media](./media_demo.md) | ![image](./media_demo.gif) | +| [Chatbot](./chatbot_demo.md) | ![image](./chatbot_demo.gif) | +| [Progress](./progress_demo.md) | ![image](./progress_demo.gif) |