humanizer_model / app.py
lucidmorto's picture
refactor: Replace custom model loading with Gradio Client
0cc4a5a
raw
history blame
627 Bytes
import gradio as gr
from gradio_client import Client
# Create a client to interact with your Space
client = Client("umutbozdag/humanizer_model")
def generate_text(input_text):
# Use the client to predict using your Space
result = client.predict(
input_text, # str in 'Input Text' Textbox component
api_name="/predict"
)
return result
iface = gr.Interface(
fn=generate_text,
inputs=gr.Textbox(lines=5, label="Input Text"),
outputs=gr.Textbox(label="Generated Text"),
title="Text Humanizer",
description="Enter text to generate a more human-like version."
)
iface.launch()