Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from
|
| 3 |
from fastapi import FastAPI
|
| 4 |
|
| 5 |
def process_youtube_url(url, language):
|
|
@@ -48,11 +48,11 @@ iface = gr.Interface(
|
|
| 48 |
],
|
| 49 |
outputs=[
|
| 50 |
gr.Textbox(label="Loaded Documents / Error Message",show_copy_button=True),
|
| 51 |
-
gr.Dropdown(label="Available Languages"),
|
| 52 |
gr.Textbox(label="Recommended Language"),
|
| 53 |
gr.Number(label="Character Count")
|
| 54 |
],
|
| 55 |
-
examples = [["https://youtu.be/6Af6b_wyiwI?si=zqD9-kjw24lpRJw3","ja"],["https://
|
| 56 |
title="YouTube Transcript Loader",
|
| 57 |
description="Enter a YouTube URL and select the language to load the transcript using LangChain's YoutubeLoader.[buy me a coffee](https://www.buymeacoffee.com/regulusle04)",
|
| 58 |
)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from langchain_community.document_loaders import YoutubeLoader
|
| 3 |
from fastapi import FastAPI
|
| 4 |
|
| 5 |
def process_youtube_url(url, language):
|
|
|
|
| 48 |
],
|
| 49 |
outputs=[
|
| 50 |
gr.Textbox(label="Loaded Documents / Error Message",show_copy_button=True),
|
| 51 |
+
gr.Dropdown(label="Available Languages", allow_custom_value=True),
|
| 52 |
gr.Textbox(label="Recommended Language"),
|
| 53 |
gr.Number(label="Character Count")
|
| 54 |
],
|
| 55 |
+
examples = [["https://youtu.be/6Af6b_wyiwI?si=zqD9-kjw24lpRJw3","ja"],["https://youtu.be/9kxL9Cf46VM?si=ADgUmDXb6riA-lgb","ja"]],
|
| 56 |
title="YouTube Transcript Loader",
|
| 57 |
description="Enter a YouTube URL and select the language to load the transcript using LangChain's YoutubeLoader.[buy me a coffee](https://www.buymeacoffee.com/regulusle04)",
|
| 58 |
)
|