Skip to content
Discussion options

You must be logged in to vote

现在已经有可直接调用的 API,不过需要区分“公共体验 API”和“本地完整版”。

1. 公共 Hugging Face Space API

当前 FunClip Space 暴露了三个命名端点:

  • /transcribe_video:转写视频并返回句级时间戳文本
  • /build_selector:读取本次转写产生的可选片段
  • /clip_video:按选择的片段剪辑并返回视频

这个公共 Space 当前固定使用中文 Paraformer;多语种模型、说话人识别和 LLM 辅助剪辑请部署本地完整版。

可以用同一个 gradio_client.Client 实例按顺序调用:

from gradio_client import Client, handle_file

client = Client("FunAudioLLM/FunClip")
video = {
    "video": handle_file("input.mp4"),
    "subtitles": None,
}

# 1. 转写;同时在当前 Client 会话中保存句级时间戳状态
transcript = client.predict(video, api_name="/transcribe_video")

# 2. 取得片段选项。Gradio 返回的是 update 字典,choices 中每项为 [label, value]
selector = client.predict(api_name="/build_selector")
choices = [item[1] for item in s…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by LauraGPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants