Spaces:
Runtime error
Runtime error
Center title and descriptions
Browse filesIt will look like this (title and descriptions centered). Wdyt?

app.py
CHANGED
|
@@ -47,15 +47,6 @@ def setup_seeds(config):
|
|
| 47 |
# Model Initialization
|
| 48 |
# ========================================
|
| 49 |
|
| 50 |
-
SHARED_UI_WARNING = f'''### [NOTE] It is possible that you are waiting in a lengthy queue.
|
| 51 |
-
|
| 52 |
-
You can duplicate and use it with a paid private GPU.
|
| 53 |
-
|
| 54 |
-
<a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/Vision-CAIR/minigpt4?duplicate=true"><img style="margin-top:0;margin-bottom:0" src="https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-xl-dark.svg" alt="Duplicate Space"></a>
|
| 55 |
-
|
| 56 |
-
Alternatively, you can also use the demo on our [project page](https://minigpt-4.github.io).
|
| 57 |
-
'''
|
| 58 |
-
|
| 59 |
print('Initializing Chat')
|
| 60 |
cfg = Config(parse_args())
|
| 61 |
|
|
@@ -100,18 +91,33 @@ def gradio_answer(chatbot, chat_state, img_list, num_beams, temperature):
|
|
| 100 |
chatbot[-1][1] = llm_message
|
| 101 |
return chatbot, chat_state, img_list
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
#TODO show examples below
|
| 109 |
|
| 110 |
with gr.Blocks() as demo:
|
| 111 |
-
gr.
|
| 112 |
-
gr.Markdown(SHARED_UI_WARNING)
|
| 113 |
-
gr.Markdown(description)
|
| 114 |
-
gr.Markdown(article)
|
| 115 |
|
| 116 |
with gr.Row():
|
| 117 |
with gr.Column(scale=0.5):
|
|
|
|
| 47 |
# Model Initialization
|
| 48 |
# ========================================
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
print('Initializing Chat')
|
| 51 |
cfg = Config(parse_args())
|
| 52 |
|
|
|
|
| 91 |
chatbot[-1][1] = llm_message
|
| 92 |
return chatbot, chat_state, img_list
|
| 93 |
|
| 94 |
+
title_and_description = """<div style="text-align: center; margin: 0 auto;">
|
| 95 |
+
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">Demo of MiniGPT-4</h1>
|
| 96 |
+
<h3>This is the demo of MiniGPT-4. Upload your images and start chatting!</h3>
|
| 97 |
+
<h3 id="-note-it-is-possible-that-you-are-waiting-in-a-lengthy-queue-">[NOTE] It is possible that you are waiting in a lengthy queue.</h3>
|
| 98 |
+
<p>You can duplicate and use it with a paid private GPU. <a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/Vision-CAIR/minigpt4?duplicate=true">
|
| 99 |
+
<img style="margin-top:0;margin-bottom:0" src="https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-lg-dark.svg" alt="Duplicate Space">
|
| 100 |
+
</a>
|
| 101 |
+
</p>
|
| 102 |
+
<p>Alternatively, you can also use the demo on our <a href="https://minigpt-4.github.io">project page</a>
|
| 103 |
+
</p>
|
| 104 |
+
<div style='display:flex; gap: 0.25rem; width: 100%; justify-content: center;'>
|
| 105 |
+
<a href='https://minigpt-4.github.io'>
|
| 106 |
+
<img src='https://img.shields.io/badge/Project-Page-Green'>
|
| 107 |
+
</a>
|
| 108 |
+
<a href='https://github.com/Vision-CAIR/MiniGPT-4'>
|
| 109 |
+
<img src='https://img.shields.io/badge/Github-Code-blue'>
|
| 110 |
+
</a>
|
| 111 |
+
<a href='https://github.com/TsuTikgiau/blip2-llm/blob/release_prepare/MiniGPT_4.pdf'>
|
| 112 |
+
<img src='https://img.shields.io/badge/Paper-PDF-red'>
|
| 113 |
+
</a>
|
| 114 |
+
</div>
|
| 115 |
+
</div>"""
|
| 116 |
|
| 117 |
#TODO show examples below
|
| 118 |
|
| 119 |
with gr.Blocks() as demo:
|
| 120 |
+
gr.HTML(title_and_description)
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
with gr.Row():
|
| 123 |
with gr.Column(scale=0.5):
|