Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import torch
|
|
| 3 |
import llava
|
| 4 |
from peft import PeftModel
|
| 5 |
import os
|
|
|
|
| 6 |
from huggingface_hub import snapshot_download
|
| 7 |
import copy
|
| 8 |
# ---------------------------------
|
|
@@ -37,6 +38,7 @@ model_think = PeftModel.from_pretrained(
|
|
| 37 |
# ---------------------------------
|
| 38 |
# SINGLE-TURN INFERENCE FUNCTION
|
| 39 |
# ---------------------------------
|
|
|
|
| 40 |
def single_turn_infer(audio_file, prompt_text):
|
| 41 |
try:
|
| 42 |
sound = llava.Sound(audio_file)
|
|
@@ -54,7 +56,7 @@ def single_turn_infer(audio_file, prompt_text):
|
|
| 54 |
# return response
|
| 55 |
# except Exception as e:
|
| 56 |
# return f"❌ Error: {str(e)}"
|
| 57 |
-
|
| 58 |
def think_infer(audio_file, prompt_text):
|
| 59 |
try:
|
| 60 |
sound = llava.Sound(audio_file)
|
|
|
|
| 3 |
import llava
|
| 4 |
from peft import PeftModel
|
| 5 |
import os
|
| 6 |
+
import spaces
|
| 7 |
from huggingface_hub import snapshot_download
|
| 8 |
import copy
|
| 9 |
# ---------------------------------
|
|
|
|
| 38 |
# ---------------------------------
|
| 39 |
# SINGLE-TURN INFERENCE FUNCTION
|
| 40 |
# ---------------------------------
|
| 41 |
+
@spaces.GPU
|
| 42 |
def single_turn_infer(audio_file, prompt_text):
|
| 43 |
try:
|
| 44 |
sound = llava.Sound(audio_file)
|
|
|
|
| 56 |
# return response
|
| 57 |
# except Exception as e:
|
| 58 |
# return f"❌ Error: {str(e)}"
|
| 59 |
+
@spaces.GPU
|
| 60 |
def think_infer(audio_file, prompt_text):
|
| 61 |
try:
|
| 62 |
sound = llava.Sound(audio_file)
|