File size: 579 Bytes
cf8c380
 
2d75752
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr

# Define your model and function to be used in the interface
model = "models/Salesforce/blip-image-captioning-large"
def predict_image_caption(image):
    # Your model prediction code here
    return "Predicted caption for the image."

# Create the Gradio interface with a password
interface = gr.Interface(
    fn=predict_image_caption,
    inputs="image",
    outputs="text",
    live=True,  # Set to False if you don't want real-time updates
    password="your_password_here"  # Set your desired password here
)

# Launch the interface
interface.launch()