Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
from gradio_client import Client
|
4 |
-
|
|
|
5 |
import cv2
|
6 |
from moviepy.editor import *
|
7 |
|
@@ -107,7 +108,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision)
|
|
107 |
def process_image(image_in):
|
108 |
|
109 |
|
110 |
-
result =
|
111 |
image_in, # filepath in 'image' Image component
|
112 |
"Describe precisely the image in one sentence.", # str in 'Question' Textbox component
|
113 |
api_name="/answer_question"
|
@@ -136,8 +137,8 @@ def extract_audio(video_path):
|
|
136 |
|
137 |
def get_salmonn(audio_in):
|
138 |
salmonn_prompt = "Please describe the audio"
|
139 |
-
|
140 |
-
result =
|
141 |
audio_in, # filepath in 'Audio' Audio component
|
142 |
salmonn_prompt, # str in 'User question' Textbox component
|
143 |
4, # float (numeric value between 1 and 10) in 'beam search numbers' Slider component
|
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
from gradio_client import Client
|
4 |
+
moondream_client = Client("https://vikhyatk-moondream1.hf.space/")
|
5 |
+
salmmon_client = Client("fffiloni/SALMONN-7B-gradio")
|
6 |
import cv2
|
7 |
from moviepy.editor import *
|
8 |
|
|
|
108 |
def process_image(image_in):
|
109 |
|
110 |
|
111 |
+
result = moondream_client.predict(
|
112 |
image_in, # filepath in 'image' Image component
|
113 |
"Describe precisely the image in one sentence.", # str in 'Question' Textbox component
|
114 |
api_name="/answer_question"
|
|
|
137 |
|
138 |
def get_salmonn(audio_in):
|
139 |
salmonn_prompt = "Please describe the audio"
|
140 |
+
|
141 |
+
result = salmmon_client.predict(
|
142 |
audio_in, # filepath in 'Audio' Audio component
|
143 |
salmonn_prompt, # str in 'User question' Textbox component
|
144 |
4, # float (numeric value between 1 and 10) in 'beam search numbers' Slider component
|