Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,3 @@
|
|
| 1 |
-
# Add this temporarily at the top of your app to list available models
|
| 2 |
-
import google.generativeai as genai
|
| 3 |
-
genai.configure(api_key=GOOGLE_API_KEY)
|
| 4 |
-
|
| 5 |
-
for m in genai.list_models():
|
| 6 |
-
if "generateContent" in m.supported_generation_methods:
|
| 7 |
-
st.write(m.name)
|
| 8 |
-
|
| 9 |
import os
|
| 10 |
import gc
|
| 11 |
import torch
|
|
@@ -394,7 +386,7 @@ with st.sidebar:
|
|
| 394 |
st.markdown("---")
|
| 395 |
st.markdown("### Pipeline Steps")
|
| 396 |
st.markdown("""
|
| 397 |
-
**1. Gemini
|
| 398 |
Generate 5 captions
|
| 399 |
|
| 400 |
**2. BLIP ITM** (Local)
|
|
@@ -417,7 +409,7 @@ Caption fusion
|
|
| 417 |
""")
|
| 418 |
st.markdown("---")
|
| 419 |
st.markdown("**Local:** BLIP ITM, DINO, Qwen2.5")
|
| 420 |
-
st.markdown("**API:** Gemini
|
| 421 |
|
| 422 |
# ============================================================================
|
| 423 |
# MAIN UI
|
|
@@ -452,7 +444,7 @@ if uploaded_file is not None:
|
|
| 452 |
progress = st.progress(0)
|
| 453 |
status = st.empty()
|
| 454 |
|
| 455 |
-
status.info("Step 1/7: Generating captions with Gemini
|
| 456 |
captions = generate_captions_gemini(input_image)
|
| 457 |
progress.progress(14)
|
| 458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import gc
|
| 3 |
import torch
|
|
|
|
| 386 |
st.markdown("---")
|
| 387 |
st.markdown("### Pipeline Steps")
|
| 388 |
st.markdown("""
|
| 389 |
+
**1. Gemini 2.0 Flash** (API)
|
| 390 |
Generate 5 captions
|
| 391 |
|
| 392 |
**2. BLIP ITM** (Local)
|
|
|
|
| 409 |
""")
|
| 410 |
st.markdown("---")
|
| 411 |
st.markdown("**Local:** BLIP ITM, DINO, Qwen2.5")
|
| 412 |
+
st.markdown("**API:** Gemini 2.0 Flash, Jina")
|
| 413 |
|
| 414 |
# ============================================================================
|
| 415 |
# MAIN UI
|
|
|
|
| 444 |
progress = st.progress(0)
|
| 445 |
status = st.empty()
|
| 446 |
|
| 447 |
+
status.info("Step 1/7: Generating captions with Gemini 2.0 Flash...")
|
| 448 |
captions = generate_captions_gemini(input_image)
|
| 449 |
progress.progress(14)
|
| 450 |
|