import gradio as gr | |
# Load the BLOOM model | |
model = gr.load("models/CreitinGameplays/bloom-3b-conversational") | |
# Define the interface with max_length limit | |
interface = gr.Interface( | |
fn=model, | |
inputs="text", | |
outputs="text", | |
max_length=250, # Limit input text length to 250 characters | |
css=""" | |
.gr-form textarea { | |
height: 100px; /* Adjust height as needed */ | |
} | |
""", # Optional: Adjust input text area height | |
description="Interact with BLOOM (limited to 250 characters)", | |
) | |
# Launch the Gradio interface | |
interface.launch() | |