Spaces:
Paused
Paused
Mandour
commited on
Commit
·
9bb64ca
1
Parent(s):
2b67a49
update token
Browse files
app.py
CHANGED
|
@@ -431,36 +431,6 @@ def create_interface():
|
|
| 431 |
visible=False
|
| 432 |
)
|
| 433 |
|
| 434 |
-
# Info section
|
| 435 |
-
with gr.Row():
|
| 436 |
-
with gr.Column():
|
| 437 |
-
gr.HTML("""
|
| 438 |
-
<div class="info-box">
|
| 439 |
-
<h3>ℹ️ About This Tool</h3>
|
| 440 |
-
<p>This AI-powered tool extracts product attributes from images and text descriptions using:</p>
|
| 441 |
-
<ul>
|
| 442 |
-
<li><strong>🖼️ Vision Transformer (DeiT)</strong> for image analysis</li>
|
| 443 |
-
<li><strong>🔤 BERT & RoBERTa</strong> for text understanding</li>
|
| 444 |
-
<li><strong>🧠 Hierarchical Fusion</strong> for multimodal learning</li>
|
| 445 |
-
<li><strong>⚡ LoRA/DoRA</strong> for efficient fine-tuning</li>
|
| 446 |
-
</ul>
|
| 447 |
-
</div>
|
| 448 |
-
""")
|
| 449 |
-
|
| 450 |
-
with gr.Column():
|
| 451 |
-
gr.HTML(f"""
|
| 452 |
-
<div class="tips-section">
|
| 453 |
-
<h3>🎯 Tips for Better Results</h3>
|
| 454 |
-
<ul>
|
| 455 |
-
<li>Use clear, well-lit images</li>
|
| 456 |
-
<li>Provide detailed descriptions</li>
|
| 457 |
-
<li>Include specific product details</li>
|
| 458 |
-
<li>Avoid blurry or low-quality images</li>
|
| 459 |
-
</ul>
|
| 460 |
-
<h4>Supported Attributes:</h4>
|
| 461 |
-
<p>{', '.join([attr.title() for attr in ATTRIBUTES_LIST])}</p>
|
| 462 |
-
</div>
|
| 463 |
-
""")
|
| 464 |
|
| 465 |
# Event handlers
|
| 466 |
def update_status(message: str, is_error: bool = False):
|
|
|
|
| 431 |
visible=False
|
| 432 |
)
|
| 433 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 434 |
|
| 435 |
# Event handlers
|
| 436 |
def update_status(message: str, is_error: bool = False):
|
models.py
CHANGED
|
@@ -164,6 +164,7 @@ class MergerModel(nn.Module):
|
|
| 164 |
def load_merger_model(bert_tokenizer, device, model_token=None):
|
| 165 |
if model_token is None:
|
| 166 |
model_token = os.getenv("MERGER_MODEL_TOKEN")
|
|
|
|
| 167 |
vocab_size = len(bert_tokenizer)
|
| 168 |
model = MergerModel(vocab_size, device)
|
| 169 |
repo_id = "MohamedMosilhy/AttentionMergerModality"
|
|
|
|
| 164 |
def load_merger_model(bert_tokenizer, device, model_token=None):
|
| 165 |
if model_token is None:
|
| 166 |
model_token = os.getenv("MERGER_MODEL_TOKEN")
|
| 167 |
+
print("MERGER_MODEL_TOKEN is set:", model_token is not None)
|
| 168 |
vocab_size = len(bert_tokenizer)
|
| 169 |
model = MergerModel(vocab_size, device)
|
| 170 |
repo_id = "MohamedMosilhy/AttentionMergerModality"
|