Spaces:
Running
on
Zero
Running
on
Zero
update
Browse files- app.py +6 -1
- requirements.txt +1 -1
app.py
CHANGED
@@ -10,7 +10,7 @@ import random
|
|
10 |
import re
|
11 |
import string
|
12 |
import threading
|
13 |
-
|
14 |
import cv2
|
15 |
import gradio as gr
|
16 |
import numpy as np
|
@@ -421,6 +421,7 @@ class ChatBotUI(object):
|
|
421 |
def set_callbacks(self, *args, **kwargs):
|
422 |
|
423 |
########################################
|
|
|
424 |
def change_model(model_name):
|
425 |
if model_name not in self.model_choices:
|
426 |
gr.Info('The provided model name is not a valid choice!')
|
@@ -489,6 +490,7 @@ class ChatBotUI(object):
|
|
489 |
outputs=[self.text, self.gallery])
|
490 |
|
491 |
########################################
|
|
|
492 |
def generate_video(message,
|
493 |
extend_prompt,
|
494 |
history,
|
@@ -569,6 +571,7 @@ class ChatBotUI(object):
|
|
569 |
outputs=[self.history, self.chatbot, self.text, self.gallery])
|
570 |
|
571 |
########################################
|
|
|
572 |
def run_chat(message,
|
573 |
extend_prompt,
|
574 |
history,
|
@@ -787,6 +790,7 @@ class ChatBotUI(object):
|
|
787 |
outputs=chat_outputs)
|
788 |
|
789 |
########################################
|
|
|
790 |
def retry_chat(*args):
|
791 |
return run_chat(self.retry_msg, *args)
|
792 |
|
@@ -795,6 +799,7 @@ class ChatBotUI(object):
|
|
795 |
outputs=chat_outputs)
|
796 |
|
797 |
########################################
|
|
|
798 |
def run_example(task, img, img_mask, ref1, prompt, seed):
|
799 |
edit_image, edit_image_mask, edit_task = [], [], []
|
800 |
if img is not None:
|
|
|
10 |
import re
|
11 |
import string
|
12 |
import threading
|
13 |
+
import spaces
|
14 |
import cv2
|
15 |
import gradio as gr
|
16 |
import numpy as np
|
|
|
421 |
def set_callbacks(self, *args, **kwargs):
|
422 |
|
423 |
########################################
|
424 |
+
@spaces.GPU(duration=120)
|
425 |
def change_model(model_name):
|
426 |
if model_name not in self.model_choices:
|
427 |
gr.Info('The provided model name is not a valid choice!')
|
|
|
490 |
outputs=[self.text, self.gallery])
|
491 |
|
492 |
########################################
|
493 |
+
@spaces.GPU(duration=120)
|
494 |
def generate_video(message,
|
495 |
extend_prompt,
|
496 |
history,
|
|
|
571 |
outputs=[self.history, self.chatbot, self.text, self.gallery])
|
572 |
|
573 |
########################################
|
574 |
+
@spaces.GPU(duration=120)
|
575 |
def run_chat(message,
|
576 |
extend_prompt,
|
577 |
history,
|
|
|
790 |
outputs=chat_outputs)
|
791 |
|
792 |
########################################
|
793 |
+
@spaces.GPU(duration=120)
|
794 |
def retry_chat(*args):
|
795 |
return run_chat(self.retry_msg, *args)
|
796 |
|
|
|
799 |
outputs=chat_outputs)
|
800 |
|
801 |
########################################
|
802 |
+
@spaces.GPU(duration=60)
|
803 |
def run_example(task, img, img_mask, ref1, prompt, seed):
|
804 |
edit_image, edit_image_mask, edit_task = [], [], []
|
805 |
if img is not None:
|
requirements.txt
CHANGED
@@ -3,6 +3,6 @@ scepter>=1.1.0
|
|
3 |
diffusers
|
4 |
transformers
|
5 |
gradio_imageslider
|
6 |
-
torch
|
7 |
torchvision
|
8 |
flash-attn
|
|
|
3 |
diffusers
|
4 |
transformers
|
5 |
gradio_imageslider
|
6 |
+
torch==2.4.0
|
7 |
torchvision
|
8 |
flash-attn
|