SreyanG-NVIDIA commited on
Commit
6bb999b
·
verified ·
1 Parent(s): 377af38

update to use ZeroGPU (#2)

Browse files

- update to use zeroGPU (68d85af1a350b9e30f98d15fdb55e3aaf30ee795)

Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -4,7 +4,8 @@ import llava
4
  from peft import PeftModel
5
  import os
6
  from huggingface_hub import snapshot_download
7
- import copy
 
8
  # ---------------------------------
9
  # SINGLE-TURN MODEL SETUP
10
  # ---------------------------------
@@ -45,6 +46,7 @@ model_think = PeftModel.from_pretrained(
45
  # ---------------------------------
46
  # SINGLE-TURN INFERENCE FUNCTION
47
  # ---------------------------------
 
48
  def single_turn_infer(audio_file, prompt_text):
49
  try:
50
  sound = llava.Sound(audio_file)
@@ -63,6 +65,7 @@ def single_turn_infer(audio_file, prompt_text):
63
  # except Exception as e:
64
  # return f"❌ Error: {str(e)}"
65
 
 
66
  def think_infer(audio_file, prompt_text):
67
  try:
68
  sound = llava.Sound(audio_file)
 
4
  from peft import PeftModel
5
  import os
6
  from huggingface_hub import snapshot_download
7
+ import copy
8
+ import spaces
9
  # ---------------------------------
10
  # SINGLE-TURN MODEL SETUP
11
  # ---------------------------------
 
46
  # ---------------------------------
47
  # SINGLE-TURN INFERENCE FUNCTION
48
  # ---------------------------------
49
+ @spaces.GPU
50
  def single_turn_infer(audio_file, prompt_text):
51
  try:
52
  sound = llava.Sound(audio_file)
 
65
  # except Exception as e:
66
  # return f"❌ Error: {str(e)}"
67
 
68
+ @spaces.GPU
69
  def think_infer(audio_file, prompt_text):
70
  try:
71
  sound = llava.Sound(audio_file)