Spaces:
Sleeping
Sleeping
import gradio as gr | |
from huggingface_hub import InferenceClient | |
token = "" # todo 支持外部传入 | |
def initClient(): | |
# Initialize client for a specific model | |
client = InferenceClient( | |
model="prompthero/openjourney-v4", | |
#base_url=..., | |
#api_key=..., | |
) | |
return client | |
def greet(name): | |
return "Hello " + name + "!!" | |
title = "demo" | |
description = "Gradio Demo for custom demo" | |
# examples = [ | |
# ["The tower is 324 metres (1,063 ft) tall,"], | |
# ["The Moon's orbit around Earth has"], | |
# ["The smooth Borealis basin in the Northern Hemisphere covers 40%"], | |
# ] | |
gr.Interface.load( | |
"huggingface/chenluuli/test-text-vis", | |
inputs=gr.Textbox(lines=5, label="Input Text"), | |
outputs="text", | |
title=title, | |
description=description, | |
# article=article, | |
# examples=examples, | |
enable_queue=True, | |
).launch() | |