freddyaboulton HF Staff commited on
Commit
e30fe8e
·
verified ·
1 Parent(s): 6df3923

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +1 -1
  2. requirements.txt +2 -2
  3. run.ipynb +1 -1
  4. run.py +1 -0
README.md CHANGED
@@ -5,7 +5,7 @@ emoji: 🔥
5
  colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
- sdk_version: 5.49.1
9
  app_file: run.py
10
  pinned: false
11
  hf_oauth: true
 
5
  colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
+ sdk_version: 6.0.0
9
  app_file: run.py
10
  pinned: false
11
  hf_oauth: true
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- gradio-client @ git+https://github.com/gradio-app/gradio@e05eb8df38a4ca20993e94ca4e209cf8110bb677#subdirectory=client/python
2
- https://gradio-pypi-previews.s3.amazonaws.com/e05eb8df38a4ca20993e94ca4e209cf8110bb677/gradio-5.49.1-py3-none-any.whl
 
1
+ gradio-client @ git+https://github.com/gradio-app/gradio@d007e6cf617baba5c62e49ec2b7ce278aa863a79#subdirectory=client/python
2
+ https://gradio-pypi-previews.s3.amazonaws.com/d007e6cf617baba5c62e49ec2b7ce278aa863a79/gradio-6.0.0-py3-none-any.whl
run.ipynb CHANGED
@@ -1 +1 @@
1
- {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: dialogue_mock_diarization"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "speakers = [\n", " \"Speaker 1\",\n", " \"Speaker 2\",\n", "]\n", "\n", "def format_speaker(speaker, text):\n", " return f\"{speaker}: {text}\"\n", "\n", "def mock_diarization(audio):\n", " return [\n", " {\n", " \"speaker\": \"Speaker 1\",\n", " \"text\": \"Hello, how are you?\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 2\",\n", " \"text\": \"I'm fine, thank you!\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 1\",\n", " \"text\": \"What's your name?\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 2\",\n", " \"text\": \"My name is John Doe.\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 1\",\n", " \"text\": \"Nice to meet you!\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 2\",\n", " \"text\": \"Nice to meet you!\",\n", " },\n", " ]\n", "\n", "demo = gr.Interface(\n", " fn=mock_diarization,\n", " inputs=[gr.Audio(sources=[\"microphone\"])],\n", " outputs=[gr.Dialogue(speakers=speakers, tags=None, formatter=format_speaker)],\n", " title=\"Mock Speech Diarization\",\n", " description=\"Mock speech diarization\",\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
 
1
+ {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: dialogue_mock_diarization"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "speakers = [\n", " \"Speaker 1\",\n", " \"Speaker 2\",\n", "]\n", "\n", "def format_speaker(speaker, text):\n", " return f\"{speaker}: {text}\"\n", "\n", "def mock_diarization(audio):\n", " return [\n", " {\n", " \"speaker\": \"Speaker 1\",\n", " \"text\": \"Hello, how are you?\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 2\",\n", " \"text\": \"I'm fine, thank you!\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 1\",\n", " \"text\": \"What's your name?\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 2\",\n", " \"text\": \"My name is John Doe.\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 1\",\n", " \"text\": \"Nice to meet you!\",\n", " },\n", " {\n", " \"speaker\": \"Speaker 2\",\n", " \"text\": \"Nice to meet you!\",\n", " },\n", " ]\n", "\n", "demo = gr.Interface(\n", " fn=mock_diarization,\n", " inputs=[gr.Audio(sources=[\"microphone\"])],\n", " outputs=[gr.Dialogue(speakers=speakers, tags=None, formatter=format_speaker)],\n", " title=\"Mock Speech Diarization\",\n", " description=\"Mock speech diarization\",\n", " api_name=\"predict\"\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
run.py CHANGED
@@ -42,6 +42,7 @@ demo = gr.Interface(
42
  outputs=[gr.Dialogue(speakers=speakers, tags=None, formatter=format_speaker)],
43
  title="Mock Speech Diarization",
44
  description="Mock speech diarization",
 
45
  )
46
 
47
  if __name__ == "__main__":
 
42
  outputs=[gr.Dialogue(speakers=speakers, tags=None, formatter=format_speaker)],
43
  title="Mock Speech Diarization",
44
  description="Mock speech diarization",
45
+ api_name="predict"
46
  )
47
 
48
  if __name__ == "__main__":