Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
from huggingface_hub import InferenceClient
|
4 |
+
token = "" # todo 支持外部传入
|
5 |
+
|
6 |
+
def initClient():
|
7 |
+
# Initialize client for a specific model
|
8 |
+
client = InferenceClient(
|
9 |
+
model="prompthero/openjourney-v4",
|
10 |
+
#base_url=...,
|
11 |
+
#api_key=...,
|
12 |
+
)
|
13 |
+
return client
|
14 |
+
|
15 |
+
def greet(name):
|
16 |
+
return "Hello " + name + "!!"
|
17 |
+
|
18 |
+
title = "demo"
|
19 |
+
description = "Gradio Demo for custom demo"
|
20 |
+
# examples = [
|
21 |
+
# ["The tower is 324 metres (1,063 ft) tall,"],
|
22 |
+
# ["The Moon's orbit around Earth has"],
|
23 |
+
# ["The smooth Borealis basin in the Northern Hemisphere covers 40%"],
|
24 |
+
# ]
|
25 |
+
gr.Interface.load(
|
26 |
+
"huggingface/chenluuli/test-text-vis",
|
27 |
+
inputs=gr.Textbox(lines=5, label="Input Text"),
|
28 |
+
outputs="text",
|
29 |
+
title=title,
|
30 |
+
description=description,
|
31 |
+
# article=article,
|
32 |
+
# examples=examples,
|
33 |
+
enable_queue=True,
|
34 |
+
).launch()
|