瀏覽代碼

Fix replicate error in ai_example

Wieland 2 年之前
父節點
當前提交
00c1dd31b5
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      examples/ai_interface/main.py

+ 2 - 1
examples/ai_interface/main.py

@@ -18,7 +18,8 @@ async def io_bound(callback: Callable, *args: any, **kwargs: any):
 async def transcribe(e: UploadEventArguments):
     transcription.text = 'Transcribing...'
     model = replicate.models.get('openai/whisper')
-    prediction = await io_bound(model.predict, audio=io.BytesIO(e.content))
+    version = model.versions.get('30414ee7c4fffc37e260fcab7842b5be470b9b840f2b608f5baa9bbef9a259ed')
+    prediction = await io_bound(version.predict, audio=io.BytesIO(e.content))
     text = prediction.get('transcription', 'no transcription')
     transcription.set_text(f'result: "{text}"')