Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_client import Client
|
3 |
+
|
4 |
+
def infer(image_in, question):
|
5 |
+
client = Client("https://fffiloni-moondream1.hf.space/--replicas/7skri/")
|
6 |
+
result = client.predict(
|
7 |
+
image_in, # filepath in 'image' Image component
|
8 |
+
question, # str in 'Question' Textbox component
|
9 |
+
api_name="/predict"
|
10 |
+
)
|
11 |
+
print(result)
|
12 |
+
return result
|
13 |
+
|
14 |
+
gr.Interface(
|
15 |
+
fn=infer,
|
16 |
+
inputs=[gr.Image(), gr.Textbox()],
|
17 |
+
outputs=[Textbox()]
|
18 |
+
).queue().launch()
|