Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -166,9 +166,9 @@ def save_image(image_input, output_dir="saved_images"):
|
|
| 166 |
raise ValueError("Invalid image input type")
|
| 167 |
|
| 168 |
def process_image(image_file_path):
|
| 169 |
-
client = Client("https://tonic1-official-qwen-vl-chat.hf.space/--replicas/t5ccx/")
|
| 170 |
try:
|
| 171 |
-
|
| 172 |
"Describe this image in detail, identify every detail in this image. Describe the image the best you can.", # TruEra
|
| 173 |
image_file_path,
|
| 174 |
fn_index=0
|
|
@@ -176,6 +176,7 @@ def process_image(image_file_path):
|
|
| 176 |
return result
|
| 177 |
except Exception as e:
|
| 178 |
return f"Error occurred during image processing: {e}"
|
|
|
|
| 179 |
def process_speech(audio_input, source_language, target_language="English"):
|
| 180 |
|
| 181 |
if audio_input is None:
|
|
|
|
| 166 |
raise ValueError("Invalid image input type")
|
| 167 |
|
| 168 |
def process_image(image_file_path):
|
| 169 |
+
client = Client("https://tonic1-official-qwen-vl-chat.hf.space/--replicas/t5ccx/") # TruEra
|
| 170 |
try:
|
| 171 |
+
result = client.predict(
|
| 172 |
"Describe this image in detail, identify every detail in this image. Describe the image the best you can.", # TruEra
|
| 173 |
image_file_path,
|
| 174 |
fn_index=0
|
|
|
|
| 176 |
return result
|
| 177 |
except Exception as e:
|
| 178 |
return f"Error occurred during image processing: {e}"
|
| 179 |
+
|
| 180 |
def process_speech(audio_input, source_language, target_language="English"):
|
| 181 |
|
| 182 |
if audio_input is None:
|