|
|
|
|
|
|
|
|
|
|
|
import os |
|
import gradio as gr |
|
|
|
|
|
gr.load_chat( |
|
os.getenv("OPENAI_API_BASE_URL"), |
|
token=os.getenv("OPENAI_API_KEY"), |
|
model="gpt-4.1-nano", |
|
chatbot=gr.Chatbot( |
|
label="ChatGPT", |
|
type="messages", |
|
show_copy_button=True, |
|
scale=1 |
|
), |
|
file_types=["image"], |
|
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."] |
|
], |
|
cache_examples=False, |
|
show_api=False |
|
).launch() |