Commit
•
9e4aac4
1
Parent(s):
aa0d25a
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ from nltk.tokenize import sent_tokenize
|
|
8 |
from transformers import *
|
9 |
import torch
|
10 |
from tqdm import tqdm # Import tqdm
|
|
|
11 |
|
12 |
# Download necessary data for nltk
|
13 |
nltk.download('punkt')
|
@@ -119,6 +120,7 @@ def process_and_translate(api_key, input_text, src_lang, tgt_lang):
|
|
119 |
def process_and_summary(api_key, input_text, src_lang, tgt_lang):
|
120 |
# Process the input text into chunks
|
121 |
chunks = process_text_input_text(input_text)
|
|
|
122 |
|
123 |
# Translate each chunk and collect the results
|
124 |
translated_chunks = []
|
|
|
8 |
from transformers import *
|
9 |
import torch
|
10 |
from tqdm import tqdm # Import tqdm
|
11 |
+
import time
|
12 |
|
13 |
# Download necessary data for nltk
|
14 |
nltk.download('punkt')
|
|
|
120 |
def process_and_summary(api_key, input_text, src_lang, tgt_lang):
|
121 |
# Process the input text into chunks
|
122 |
chunks = process_text_input_text(input_text)
|
123 |
+
time.sleep(30)
|
124 |
|
125 |
# Translate each chunk and collect the results
|
126 |
translated_chunks = []
|