Commit ·
2d75752
1
Parent(s): cf8c380
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
# Define your model and function to be used in the interface
|
| 4 |
+
model = "models/Salesforce/blip-image-captioning-large"
|
| 5 |
+
def predict_image_caption(image):
|
| 6 |
+
# Your model prediction code here
|
| 7 |
+
return "Predicted caption for the image."
|
| 8 |
+
|
| 9 |
+
# Create the Gradio interface with a password
|
| 10 |
+
interface = gr.Interface(
|
| 11 |
+
fn=predict_image_caption,
|
| 12 |
+
inputs="image",
|
| 13 |
+
outputs="text",
|
| 14 |
+
live=True, # Set to False if you don't want real-time updates
|
| 15 |
+
password="your_password_here" # Set your desired password here
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
# Launch the interface
|
| 19 |
+
interface.launch()
|