Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files- README.md +3 -2
- app.py +10 -2
- requirements.txt +11 -9
README.md
CHANGED
|
@@ -4,8 +4,9 @@ emoji: 🤖
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
-
---
|
|
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.0.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
+
---
|
| 12 |
+
|
app.py
CHANGED
|
@@ -180,7 +180,7 @@ def create_chat_ui():
|
|
| 180 |
#chatbot { height: 650px !important; overflow-y: auto; }
|
| 181 |
"""
|
| 182 |
|
| 183 |
-
with gr.Blocks(
|
| 184 |
|
| 185 |
with gr.Row():
|
| 186 |
gr.Markdown("# 🤖Robust-R1:Degradation-Aware Reasoning for Robust Visual Understanding")
|
|
@@ -190,7 +190,6 @@ def create_chat_ui():
|
|
| 190 |
chatbot = gr.Chatbot(
|
| 191 |
elem_id="chatbot",
|
| 192 |
label="Chat",
|
| 193 |
-
type="messages",
|
| 194 |
avatar_images=(None, "https://api.dicebear.com/7.x/bottts/svg?seed=Qwen"),
|
| 195 |
height=650
|
| 196 |
)
|
|
@@ -291,15 +290,24 @@ def create_chat_ui():
|
|
| 291 |
if __name__ == "__main__":
|
| 292 |
demo = create_chat_ui()
|
| 293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
if is_spaces:
|
| 295 |
print(f"🚀 Running on Hugging Face Spaces: {os.getenv('SPACE_ID')}")
|
| 296 |
demo.launch(
|
|
|
|
|
|
|
| 297 |
show_error=True,
|
| 298 |
allowed_paths=[project_dir] if project_dir else None
|
| 299 |
)
|
| 300 |
else:
|
| 301 |
print(f"🚀 Service is starting, please visit: http://localhost:7860")
|
| 302 |
demo.launch(
|
|
|
|
|
|
|
| 303 |
server_name="0.0.0.0",
|
| 304 |
server_port=7860,
|
| 305 |
share=False,
|
|
|
|
| 180 |
#chatbot { height: 650px !important; overflow-y: auto; }
|
| 181 |
"""
|
| 182 |
|
| 183 |
+
with gr.Blocks(title="Robust-R1") as demo:
|
| 184 |
|
| 185 |
with gr.Row():
|
| 186 |
gr.Markdown("# 🤖Robust-R1:Degradation-Aware Reasoning for Robust Visual Understanding")
|
|
|
|
| 190 |
chatbot = gr.Chatbot(
|
| 191 |
elem_id="chatbot",
|
| 192 |
label="Chat",
|
|
|
|
| 193 |
avatar_images=(None, "https://api.dicebear.com/7.x/bottts/svg?seed=Qwen"),
|
| 194 |
height=650
|
| 195 |
)
|
|
|
|
| 290 |
if __name__ == "__main__":
|
| 291 |
demo = create_chat_ui()
|
| 292 |
|
| 293 |
+
custom_css = """
|
| 294 |
+
.gradio-container { font-family: 'Inter', sans-serif; }
|
| 295 |
+
#chatbot { height: 650px !important; overflow-y: auto; }
|
| 296 |
+
"""
|
| 297 |
+
|
| 298 |
if is_spaces:
|
| 299 |
print(f"🚀 Running on Hugging Face Spaces: {os.getenv('SPACE_ID')}")
|
| 300 |
demo.launch(
|
| 301 |
+
theme=gr.themes.Soft(),
|
| 302 |
+
css=custom_css,
|
| 303 |
show_error=True,
|
| 304 |
allowed_paths=[project_dir] if project_dir else None
|
| 305 |
)
|
| 306 |
else:
|
| 307 |
print(f"🚀 Service is starting, please visit: http://localhost:7860")
|
| 308 |
demo.launch(
|
| 309 |
+
theme=gr.themes.Soft(),
|
| 310 |
+
css=custom_css,
|
| 311 |
server_name="0.0.0.0",
|
| 312 |
server_port=7860,
|
| 313 |
share=False,
|
requirements.txt
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
-
gradio>=
|
| 2 |
-
torch>=2.0.0
|
| 3 |
-
torchvision
|
| 4 |
-
transformers>=4.37.0
|
| 5 |
-
qwen-vl-utils
|
| 6 |
-
accelerate
|
| 7 |
-
sentencepiece
|
| 8 |
-
protobuf
|
| 9 |
-
pillow
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio>=6.0.0
|
| 2 |
+
torch>=2.0.0
|
| 3 |
+
torchvision>=0.15.0
|
| 4 |
+
transformers>=4.37.0
|
| 5 |
+
qwen-vl-utils
|
| 6 |
+
accelerate
|
| 7 |
+
sentencepiece
|
| 8 |
+
protobuf
|
| 9 |
+
pillow
|
| 10 |
+
flash-attn
|
| 11 |
+
einops
|