Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor, TextIteratorStreamer
|
2 |
from PIL import Image
|
3 |
import torch
|
@@ -115,7 +116,7 @@ def process_uploaded_file(file):
|
|
115 |
logger.error(f"Error in process_file: {str(e)}")
|
116 |
return "An error occurred while processing the file. Please try again."
|
117 |
|
118 |
-
@spaces.GPU()
|
119 |
def bot_streaming(user_prompt, max_new_tokens=4096):
|
120 |
try:
|
121 |
if not user_prompt.strip():
|
|
|
1 |
+
import spaces
|
2 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor, TextIteratorStreamer
|
3 |
from PIL import Image
|
4 |
import torch
|
|
|
116 |
logger.error(f"Error in process_file: {str(e)}")
|
117 |
return "An error occurred while processing the file. Please try again."
|
118 |
|
119 |
+
@spaces.GPU(duration=240)
|
120 |
def bot_streaming(user_prompt, max_new_tokens=4096):
|
121 |
try:
|
122 |
if not user_prompt.strip():
|