Spaces:
Build error
Build error
UI changes
Browse files- app.py +7 -10
- fromage/models.py +1 -1
app.py
CHANGED
|
@@ -37,17 +37,13 @@ css = """
|
|
| 37 |
background-image: linear-gradient(to right bottom, rgba(130,217,244, 0.9), rgba(158,231,214, 1.0));
|
| 38 |
}
|
| 39 |
#save-btn:hover {
|
| 40 |
-
background-image: linear-gradient(to right bottom, rgba(
|
| 41 |
}
|
| 42 |
#share-btn-2 {
|
| 43 |
background-image: linear-gradient(to right bottom, rgba(130,217,244, 0.9), rgba(158,231,214, 1.0));
|
| 44 |
}
|
| 45 |
#share-btn-2:hover {
|
| 46 |
-
background-image: linear-gradient(to right bottom, rgba(
|
| 47 |
-
}
|
| 48 |
-
.message .user {
|
| 49 |
-
}
|
| 50 |
-
.message .bot {
|
| 51 |
}
|
| 52 |
"""
|
| 53 |
|
|
@@ -166,7 +162,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 166 |
with gr.Row():
|
| 167 |
with gr.Column(scale=0.7, min_width=500):
|
| 168 |
with gr.Row():
|
| 169 |
-
chatbot = gr.Chatbot(elem_id="chatbot", label="FROMAGe Chatbot")
|
| 170 |
with gr.Row():
|
| 171 |
image_btn = gr.UploadButton("🖼️ Upload Image", file_types=["image"])
|
| 172 |
|
|
@@ -190,7 +186,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 190 |
max_ret_images = gr.Number(
|
| 191 |
minimum=0, maximum=3, value=2, precision=1, interactive=True, label="Max images to return")
|
| 192 |
gr_max_len = gr.Slider(minimum=1, maximum=64, value=32,
|
| 193 |
-
step=1, interactive=True, label="Max # of words
|
| 194 |
gr_temperature = gr.Slider(
|
| 195 |
minimum=0.0, maximum=1.0, value=0.0, interactive=True, label="Temperature (0 for deterministic, higher for more randomness)")
|
| 196 |
|
|
@@ -212,5 +208,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 212 |
save_button.click(None, [], [], _js=save_js)
|
| 213 |
|
| 214 |
|
| 215 |
-
demo.queue(concurrency_count=1, api_open=False, max_size=16)
|
| 216 |
-
demo.launch(debug=True, server_name="0.0.0.0")
|
|
|
|
|
|
| 37 |
background-image: linear-gradient(to right bottom, rgba(130,217,244, 0.9), rgba(158,231,214, 1.0));
|
| 38 |
}
|
| 39 |
#save-btn:hover {
|
| 40 |
+
background-image: linear-gradient(to right bottom, rgba(110,197,224, 0.9), rgba(138,211,194, 1.0));
|
| 41 |
}
|
| 42 |
#share-btn-2 {
|
| 43 |
background-image: linear-gradient(to right bottom, rgba(130,217,244, 0.9), rgba(158,231,214, 1.0));
|
| 44 |
}
|
| 45 |
#share-btn-2:hover {
|
| 46 |
+
background-image: linear-gradient(to right bottom, rgba(110,197,224, 0.9), rgba(138,211,194, 1.0));
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
"""
|
| 49 |
|
|
|
|
| 162 |
with gr.Row():
|
| 163 |
with gr.Column(scale=0.7, min_width=500):
|
| 164 |
with gr.Row():
|
| 165 |
+
chatbot = gr.Chatbot(elem_id="chatbot", label="🧀 FROMAGe Chatbot")
|
| 166 |
with gr.Row():
|
| 167 |
image_btn = gr.UploadButton("🖼️ Upload Image", file_types=["image"])
|
| 168 |
|
|
|
|
| 186 |
max_ret_images = gr.Number(
|
| 187 |
minimum=0, maximum=3, value=2, precision=1, interactive=True, label="Max images to return")
|
| 188 |
gr_max_len = gr.Slider(minimum=1, maximum=64, value=32,
|
| 189 |
+
step=1, interactive=True, label="Max # of words")
|
| 190 |
gr_temperature = gr.Slider(
|
| 191 |
minimum=0.0, maximum=1.0, value=0.0, interactive=True, label="Temperature (0 for deterministic, higher for more randomness)")
|
| 192 |
|
|
|
|
| 208 |
save_button.click(None, [], [], _js=save_js)
|
| 209 |
|
| 210 |
|
| 211 |
+
# demo.queue(concurrency_count=1, api_open=False, max_size=16)
|
| 212 |
+
# demo.launch(debug=True, server_name="0.0.0.0")
|
| 213 |
+
demo.launch(debug=True, server_name="127.0.0.1")
|
fromage/models.py
CHANGED
|
@@ -640,7 +640,7 @@ def load_fromage(embeddings_dir: str, model_args_path: str, model_ckpt_path: str
|
|
| 640 |
assert len(ret_token_idx) == 1, ret_token_idx
|
| 641 |
model_kwargs['retrieval_token_idx'] = ret_token_idx[0]
|
| 642 |
|
| 643 |
-
debug =
|
| 644 |
if debug:
|
| 645 |
model_kwargs['opt_version'] = 'facebook/opt-125m'
|
| 646 |
model_kwargs['visual_encoder'] = 'openai/clip-vit-base-patch32'
|
|
|
|
| 640 |
assert len(ret_token_idx) == 1, ret_token_idx
|
| 641 |
model_kwargs['retrieval_token_idx'] = ret_token_idx[0]
|
| 642 |
|
| 643 |
+
debug = True
|
| 644 |
if debug:
|
| 645 |
model_kwargs['opt_version'] = 'facebook/opt-125m'
|
| 646 |
model_kwargs['visual_encoder'] = 'openai/clip-vit-base-patch32'
|