Spaces:
Runtime error
Runtime error
liampro
commited on
Commit
•
bce51ff
1
Parent(s):
042e421
feat: init.
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
|
4 |
+
def generate_mutimodal(title, context, img):
|
5 |
+
return f"Title:{title}\n Context: {context} \n {img} "
|
6 |
+
|
7 |
+
|
8 |
+
server = gr.Interface(
|
9 |
+
fn=generate_mutimodal,
|
10 |
+
inputs=[
|
11 |
+
gr.Textbox(lines=1, placeholder="请输入标题"),
|
12 |
+
gr.Textbox(lines=2, placeholder="请输入正文"),
|
13 |
+
gr.Image(shape=(200, 200), label="请上传图片(可选)")
|
14 |
+
],
|
15 |
+
outputs="text"
|
16 |
+
)
|
17 |
+
|
18 |
+
|
19 |
+
if __name__ == '__main__':
|
20 |
+
server.launch(share=True)
|
21 |
+
pass
|