Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def process_youtube_url(url, language):
|
|
| 14 |
text = str(docs)
|
| 15 |
char_count = len(text)
|
| 16 |
|
| 17 |
-
text_splitter = TokenTextSplitter(chunk_size=
|
| 18 |
chunks = text_splitter.split_text(text)
|
| 19 |
|
| 20 |
output_textboxes = [gr.Textbox(label=f"Chunk {i+1}", value=chunk, show_copy_button=True) for i, chunk in enumerate(chunks)]
|
|
@@ -54,7 +54,7 @@ iface = gr.Interface(
|
|
| 54 |
gr.Dropdown(label="Language",value="ja",choices=["en","en-US", "ja", "fr","de","it"],allow_custom_value=True),
|
| 55 |
],
|
| 56 |
outputs=[
|
| 57 |
-
gr.Column(),
|
| 58 |
gr.Dropdown(label="Available Languages", allow_custom_value=True),
|
| 59 |
gr.Textbox(label="Recommended Language"),
|
| 60 |
gr.Number(label="Character Count")
|
|
|
|
| 14 |
text = str(docs)
|
| 15 |
char_count = len(text)
|
| 16 |
|
| 17 |
+
text_splitter = TokenTextSplitter(chunk_size=10000, chunk_overlap=0)
|
| 18 |
chunks = text_splitter.split_text(text)
|
| 19 |
|
| 20 |
output_textboxes = [gr.Textbox(label=f"Chunk {i+1}", value=chunk, show_copy_button=True) for i, chunk in enumerate(chunks)]
|
|
|
|
| 54 |
gr.Dropdown(label="Language",value="ja",choices=["en","en-US", "ja", "fr","de","it"],allow_custom_value=True),
|
| 55 |
],
|
| 56 |
outputs=[
|
| 57 |
+
gr.Column(output_textboxes),
|
| 58 |
gr.Dropdown(label="Available Languages", allow_custom_value=True),
|
| 59 |
gr.Textbox(label="Recommended Language"),
|
| 60 |
gr.Number(label="Character Count")
|