Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Robust-R1
|
| 3 |
-
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 |
-
---
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Robust-R1
|
| 3 |
+
emoji: 🤖
|
| 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
|
@@ -5,6 +5,9 @@ from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
|
|
| 5 |
from qwen_vl_utils import process_vision_info
|
| 6 |
import html
|
| 7 |
|
|
|
|
|
|
|
|
|
|
| 8 |
sys_prompt = """First output the the types of degradations in image briefly in <TYPE> <TYPE_END> tags,
|
| 9 |
and then output what effects do these degradation have on the image in <INFLUENCE> <INFLUENCE_END> tags,
|
| 10 |
then based on the strength of degradation, output an APPROPRIATE length for the reasoning process in <REASONING> <REASONING_END> tags,
|
|
|
|
| 5 |
from qwen_vl_utils import process_vision_info
|
| 6 |
import html
|
| 7 |
|
| 8 |
+
import subprocess
|
| 9 |
+
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
| 10 |
+
|
| 11 |
sys_prompt = """First output the the types of degradations in image briefly in <TYPE> <TYPE_END> tags,
|
| 12 |
and then output what effects do these degradation have on the image in <INFLUENCE> <INFLUENCE_END> tags,
|
| 13 |
then based on the strength of degradation, output an APPROPRIATE length for the reasoning process in <REASONING> <REASONING_END> tags,
|