Update app.py
Browse files
app.py
CHANGED
|
@@ -52,15 +52,18 @@ from PIL import Image
|
|
| 52 |
# # demo.launch()
|
| 53 |
# demo.launch(share=False)
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
def greet(name, intensity):
|
| 58 |
-
return "Hello, " + name + "!" * int(intensity)
|
| 59 |
|
| 60 |
demo = gr.Interface(
|
| 61 |
-
fn=
|
| 62 |
-
inputs=[
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
)
|
| 65 |
|
|
|
|
| 66 |
demo.launch()
|
|
|
|
| 52 |
# # demo.launch()
|
| 53 |
# demo.launch(share=False)
|
| 54 |
|
| 55 |
+
def predict(image: Image.Image, prompt: str = "") -> str:
|
| 56 |
+
return f"โ
UI OK! Prompt: {prompt}"
|
|
|
|
|
|
|
| 57 |
|
| 58 |
demo = gr.Interface(
|
| 59 |
+
fn=predict,
|
| 60 |
+
inputs=[
|
| 61 |
+
gr.Image(type="pil", label="แบขnh"),
|
| 62 |
+
gr.Textbox(label="Prompt")
|
| 63 |
+
],
|
| 64 |
+
outputs="text",
|
| 65 |
+
title="Test Gradio UI"
|
| 66 |
)
|
| 67 |
|
| 68 |
+
# **BแบฎT BUแปC** gแปi launch() แป cuแปi
|
| 69 |
demo.launch()
|