o3 / app.py
hadadrjt's picture
o3: Drop fill width.
3785aac
#
# SPDX-FileCopyrightText: Hadad <[email protected]>
# SPDX-License-Identifier: Apache-2.0
#
import os # Used for accessing environment variables
import gradio as gr # Used to create the user interface
# Gradio user interface
gr.load_chat(
os.getenv("OPENAI_API_BASE_URL"), # Endpoint
token=os.getenv("OPENAI_API_KEY"), # API Key
model="o3", # Model
description="""
<b>Demo only! <a href="https://umint-openwebui.hf.space"
target="_blank">Click here</a> to continue.
Please read the
<a href="https://huggingface.co/spaces/umint/ai/discussions"
target="_blank">discussions</a> before you go.
Like this project? Feel free to buy me a
<a href="https://ko-fi.com/hadad" target="_blank">
coffee</a></b>.
""", # Project description
chatbot=gr.Chatbot(
label="ChatGPT | o3 | LIMITED", # Chatbot title
type="messages", # OpenAI-style messages format
show_copy_button=True, # Allow users to copy responses
scale=1 # Standard display scaling
),
file_types=["image"], # Multimodal
examples=[
["Please introduce yourself."],
[{"text": "Explain about this image.",
"files": ["assets/images/9299765.jpg"]}],
["Give me a short introduction to large language model."],
["Explain about quantum computers."]
], # Provide sample inputs for users to try
cache_examples=False, # Ensure responses always fresh
show_api=False # Disable Gradio API
).launch(
max_file_size="1mb" # Max image upload size limit
) # Start the app