Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -226,7 +226,21 @@ def get_table_download_link(file_path):
|
|
226 |
return href
|
227 |
|
228 |
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
|
231 |
def FileSidebar():
|
232 |
# ----------------------------------------------------- File Sidebar for Jump Gates ------------------------------------------
|
@@ -1043,23 +1057,6 @@ def divide_prompt(prompt, max_length):
|
|
1043 |
return chunks
|
1044 |
|
1045 |
|
1046 |
-
# 13. Provide way of saving all and deleting all to give way of reviewing output and saving locally before clearing it
|
1047 |
-
|
1048 |
-
@st.cache_resource
|
1049 |
-
def create_zip_of_files(files):
|
1050 |
-
zip_name = "all_files.zip"
|
1051 |
-
with zipfile.ZipFile(zip_name, 'w') as zipf:
|
1052 |
-
for file in files:
|
1053 |
-
zipf.write(file)
|
1054 |
-
return zip_name
|
1055 |
-
|
1056 |
-
@st.cache_resource
|
1057 |
-
def get_zip_download_link(zip_file):
|
1058 |
-
with open(zip_file, 'rb') as f:
|
1059 |
-
data = f.read()
|
1060 |
-
b64 = base64.b64encode(data).decode()
|
1061 |
-
href = f'<a href="data:application/zip;base64,{b64}" download="{zip_file}">Download All</a>'
|
1062 |
-
return href
|
1063 |
|
1064 |
# 14. Inference Endpoints for Whisper (best fastest STT) on NVIDIA T4 and Llama (best fastest AGI LLM) on NVIDIA A10
|
1065 |
API_URL_IE = f'https://tonpixzfvq3791u9.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
226 |
return href
|
227 |
|
228 |
|
229 |
+
@st.cache_resource
|
230 |
+
def create_zip_of_files(files):
|
231 |
+
zip_name = "all_files.zip"
|
232 |
+
with zipfile.ZipFile(zip_name, 'w') as zipf:
|
233 |
+
for file in files:
|
234 |
+
zipf.write(file)
|
235 |
+
return zip_name
|
236 |
+
|
237 |
+
@st.cache_resource
|
238 |
+
def get_zip_download_link(zip_file):
|
239 |
+
with open(zip_file, 'rb') as f:
|
240 |
+
data = f.read()
|
241 |
+
b64 = base64.b64encode(data).decode()
|
242 |
+
href = f'<a href="data:application/zip;base64,{b64}" download="{zip_file}">Download All</a>'
|
243 |
+
return href
|
244 |
|
245 |
def FileSidebar():
|
246 |
# ----------------------------------------------------- File Sidebar for Jump Gates ------------------------------------------
|
|
|
1057 |
return chunks
|
1058 |
|
1059 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1060 |
|
1061 |
# 14. Inference Endpoints for Whisper (best fastest STT) on NVIDIA T4 and Llama (best fastest AGI LLM) on NVIDIA A10
|
1062 |
API_URL_IE = f'https://tonpixzfvq3791u9.us-east-1.aws.endpoints.huggingface.cloud'
|