Spaces:
Paused
Paused
File size: 897 Bytes
597aead 0b909d1 597aead 0b909d1 597aead 0b909d1 597aead 0b909d1 597aead | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # app.py (updated to commit cfe7995993fd938b55a636e62824f08993bb9d53)
import os
import sys
import time
import gradio as gr
import requests
import dashscope
from dashscope.utils.oss_utils import check_and_upload_local
# === 環境変数とAPIキーの設定 ===
DASHSCOPE_API_KEY = os.getenv("DASHSCOPE_API_KEY")
if not DASHSCOPE_API_KEY:
print("⚠️ Warning: DASHSCOPE_API_KEY is not set. Please set it in your Hugging Face Space settings.")
else:
dashscope.api_key = DASHSCOPE_API_KEY
class WanAnimateApp:
def __init__(self, url, get_url):
self.url = url
self.get_url = get_url
def predict(self, ref_img, video, model_id, model):
if not DASHSCOPE_API_KEY:
return None, "❌ Error: DASHSCOPE_API_KEY not found. Please set your key in environment variables."
# === Upload files to OSS ===
_, image_url = check_and_upload
|