Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,10 +16,11 @@ headers = {"Authorization": f"Bearer {os.getenv('HF_TOKEN')}"}
|
|
16 |
|
17 |
def generate_caption(image):
|
18 |
pixel_values = feature_extractor(images=image, return_tensors="pt").pixel_values
|
19 |
-
output_ids = caption_model.generate(pixel_values, max_length=50
|
20 |
caption = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
21 |
return caption
|
22 |
|
|
|
23 |
def tts_audio(text):
|
24 |
payload = {"inputs": text}
|
25 |
response = requests.post(CHAT_TTS_API, headers=headers, json=payload)
|
|
|
16 |
|
17 |
def generate_caption(image):
|
18 |
pixel_values = feature_extractor(images=image, return_tensors="pt").pixel_values
|
19 |
+
output_ids = caption_model.generate(pixel_values, max_length=50) # <- ✅ beam search 제거
|
20 |
caption = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
21 |
return caption
|
22 |
|
23 |
+
|
24 |
def tts_audio(text):
|
25 |
payload = {"inputs": text}
|
26 |
response = requests.post(CHAT_TTS_API, headers=headers, json=payload)
|