Spaces:
Runtime error
Runtime error
title: FastapiSample | |
emoji: 📝 | |
colorFrom: yellow | |
colorTo: yellow | |
sdk: docker | |
app_file: app.py | |
pinned: false | |
license: mit | |
# FastAPI アプリケーションの Hugging Face へのデプロイ | |
このリポジトリは、FastAPI アプリケーションを Hugging Face にデプロイする方法を示すチュートリアルです。 | |
アプリケーションは [https://tregu0458-fastapisample.hf.space](https://tregu0458-fastapisample.hf.space) で利用可能です。 | |
[apiのマニュアル](https://tregu0458-fastapisample.hf.space/docs) | |
## エンドポイント | |
### ホーム | |
- URL: `/` | |
- メソッド: GET | |
- レスポンス: `{'detail': 'Welcome to FastAPI Tutorial!'}` | |
### hello | |
- URL: `/` | |
- メソッド: POST | |
- パラメータ: | |
- `name` (str): 名前 | |
- レスポンス: `{'message': 'hello {name}!'}` | |
## Hugging Face へのデプロイ | |
1. Hugging Face のアカウントを作成し、ログインします。 | |
2. 新しいモデルリポジトリを作成します。 | |
3. このリポジトリをクローンし、`main.py` ファイルをアップロードします。 | |
4. Hugging Face のモデルページで、"Deploy" タブを開き、"Spaces" を選択します。 | |
5. "Create New Space" をクリックし、Space の名前を入力して、"Create" をクリックします。 | |
6. "Deploy" ボタンをクリックし、デプロイが完了するまで待ちます。 | |
デプロイが完了すると、Hugging Face の Space URL でアプリケーションにアクセスできます。 | |
## 参考資料 | |
- [Hugging Face Spaces のドキュメント](https://huggingface.co/blog/HemanthSai7/deploy-applications-on-huggingface-spaces) |