Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,13 +1,47 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 📝
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: docker
|
| 7 |
app_file: app.py
|
| 8 |
pinned: false
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# FastAPI
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: FastapiSample
|
| 3 |
emoji: 📝
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: docker
|
| 7 |
app_file: app.py
|
| 8 |
pinned: false
|
| 9 |
+
license: mit
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# FastAPI アプリケーションの Hugging Face へのデプロイ
|
| 13 |
|
| 14 |
+
このリポジトリは、FastAPI アプリケーションを Hugging Face にデプロイする方法を示すチュートリアルです。
|
| 15 |
+
|
| 16 |
+
アプリケーションは [https://tregu0458-fastapisample.hf.space](https://tregu0458-fastapisample.hf.space) で利用可能です。
|
| 17 |
+
[apiのマニュアル](https://tregu0458-fastapisample.hf.space/docs)
|
| 18 |
+
## エンドポイント
|
| 19 |
+
|
| 20 |
+
### ホーム
|
| 21 |
+
|
| 22 |
+
- URL: `/`
|
| 23 |
+
- メソッド: GET
|
| 24 |
+
- レスポンス: `{'detail': 'Welcome to FastAPI Tutorial!'}`
|
| 25 |
+
|
| 26 |
+
### hello
|
| 27 |
+
|
| 28 |
+
- URL: `/`
|
| 29 |
+
- メソッド: POST
|
| 30 |
+
- パラメータ:
|
| 31 |
+
- `name` (str): 名前
|
| 32 |
+
- レスポンス: `{'message': 'hello {name}!'}`
|
| 33 |
+
|
| 34 |
+
## Hugging Face へのデプロイ
|
| 35 |
+
|
| 36 |
+
1. Hugging Face のアカウントを作成し、ログインします。
|
| 37 |
+
2. 新しいモデルリポジトリを作成します。
|
| 38 |
+
3. このリポジトリをクローンし、`main.py` ファイルをアップロードします。
|
| 39 |
+
4. Hugging Face のモデルページで、"Deploy" タブを開き、"Spaces" を選択します。
|
| 40 |
+
5. "Create New Space" をクリックし、Space の名前を入力して、"Create" をクリックします。
|
| 41 |
+
6. "Deploy" ボタンをクリックし、デプロイが完了するまで待ちます。
|
| 42 |
+
|
| 43 |
+
デプロイが完了すると、Hugging Face の Space URL でアプリケーションにアクセスできます。
|
| 44 |
+
|
| 45 |
+
## 参考資料
|
| 46 |
+
|
| 47 |
+
- [Hugging Face Spaces のドキュメント](https://huggingface.co/blog/HemanthSai7/deploy-applications-on-huggingface-spaces)
|