Spaces:
Sleeping
Sleeping
import gradio as gr | |
# モデルのロード | |
model = gr.load("models/Miwa-Keita/zenz-v1-checkpoints") | |
# カスタム関数を定義 | |
def preprocess_input(user_input): | |
prefix = "\uEE00" # 前に付与する文字列 | |
suffix = "\uEE01" # 後ろに付与する文字列 | |
processed_input = prefix + user_input + suffix | |
return model(processed_input) | |
# インターフェースを定義 | |
iface = gr.Interface( | |
fn=preprocess_input, | |
inputs="text", | |
outputs="text", | |
title="ニューラルかな漢字変換モデルzenz-v1のデモ", | |
description="変換したい文字列をカタカナを入力してください" | |
) | |
# ローンチ | |
iface.launch() |