Update joycaption.py
Browse files- joycaption.py +2 -2
joycaption.py
CHANGED
|
@@ -271,7 +271,7 @@ load_text_model(MODEL_PATH, None, LOAD_IN_NF4, True)
|
|
| 271 |
#print(f"pixtral_processor: {type(pixtral_processor)}") #
|
| 272 |
|
| 273 |
|
| 274 |
-
|
| 275 |
@torch.inference_mode()
|
| 276 |
def stream_chat_mod(input_image: Image.Image, caption_type: str, caption_length: Union[str, int], extra_options: list[str], name_input: str, custom_prompt: str,
|
| 277 |
max_new_tokens: int=300, top_p: float=0.9, temperature: float=0.6, model_name: str=MODEL_PATH, progress=gr.Progress(track_tqdm=True)) -> tuple[str, str]:
|
|
@@ -474,7 +474,7 @@ def get_repo_gguf(repo_id: str):
|
|
| 474 |
else: return gr.update(value=files[0], choices=files)
|
| 475 |
|
| 476 |
|
| 477 |
-
|
| 478 |
def change_text_model(model_name: str=MODEL_PATH, use_client: bool=False, gguf_file: Union[str, None]=None,
|
| 479 |
is_nf4: bool=True, is_lora: bool=True, progress=gr.Progress(track_tqdm=True)):
|
| 480 |
global use_inference_client, llm_models
|
|
|
|
| 271 |
#print(f"pixtral_processor: {type(pixtral_processor)}") #
|
| 272 |
|
| 273 |
|
| 274 |
+
@spaces.GPU()
|
| 275 |
@torch.inference_mode()
|
| 276 |
def stream_chat_mod(input_image: Image.Image, caption_type: str, caption_length: Union[str, int], extra_options: list[str], name_input: str, custom_prompt: str,
|
| 277 |
max_new_tokens: int=300, top_p: float=0.9, temperature: float=0.6, model_name: str=MODEL_PATH, progress=gr.Progress(track_tqdm=True)) -> tuple[str, str]:
|
|
|
|
| 474 |
else: return gr.update(value=files[0], choices=files)
|
| 475 |
|
| 476 |
|
| 477 |
+
@spaces.GPU
|
| 478 |
def change_text_model(model_name: str=MODEL_PATH, use_client: bool=False, gguf_file: Union[str, None]=None,
|
| 479 |
is_nf4: bool=True, is_lora: bool=True, progress=gr.Progress(track_tqdm=True)):
|
| 480 |
global use_inference_client, llm_models
|