Spaces:
Running
Running
move files around (#17)
Browse files* move files around
* move main file to app.py
- Procfile +0 -1
- README.md +1 -2
- gradio_app.py β app.py +0 -0
- embed_documents.py β data/embed_documents.py +0 -0
- markdown_parser.py β data/markdown_parser.py +0 -0
- title_link_langchaincourse.json β data/title_link_langchaincourse.json +0 -0
- setup.sh +0 -2
- utils.py +0 -53
Procfile
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
web: source setup.sh && python gradio_app.py
|
|
|
|
README.md
CHANGED
@@ -4,7 +4,6 @@ emoji: π€
|
|
4 |
colorFrom: pink
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
-
|
8 |
-
app_file: gradio_app.py
|
9 |
pinned: false
|
10 |
---
|
|
|
4 |
colorFrom: pink
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
+
app_file: app.py
|
|
|
8 |
pinned: false
|
9 |
---
|
gradio_app.py β app.py
RENAMED
File without changes
|
embed_documents.py β data/embed_documents.py
RENAMED
File without changes
|
markdown_parser.py β data/markdown_parser.py
RENAMED
File without changes
|
title_link_langchaincourse.json β data/title_link_langchaincourse.json
RENAMED
File without changes
|
setup.sh
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
export GRADIO_SERVER_NAME=0.0.0.0
|
2 |
-
export GRADIO_SERVER_PORT=$PORT
|
|
|
|
|
|
utils.py
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import zipfile
|
3 |
-
|
4 |
-
|
5 |
-
def zip_contents(input_path, output_path):
|
6 |
-
"""
|
7 |
-
Zips the entire contents of a given path to a custom output path.
|
8 |
-
|
9 |
-
Authored by ChatGPT
|
10 |
-
|
11 |
-
Args:
|
12 |
-
input_path (str): The path of the directory to be zipped.
|
13 |
-
output_path (str): The path where the zip file will be created.
|
14 |
-
|
15 |
-
Returns:
|
16 |
-
str: The path of the created zip file.
|
17 |
-
"""
|
18 |
-
if not os.path.exists(input_path):
|
19 |
-
raise ValueError("The specified input path does not exist.")
|
20 |
-
|
21 |
-
zip_file_name = f"{os.path.basename(input_path)}.zip"
|
22 |
-
zip_file_path = os.path.join(output_path, zip_file_name)
|
23 |
-
|
24 |
-
with zipfile.ZipFile(zip_file_path, "w", zipfile.ZIP_DEFLATED) as zipf:
|
25 |
-
for root, _, files in os.walk(input_path):
|
26 |
-
for file in files:
|
27 |
-
file_path = os.path.join(root, file)
|
28 |
-
arcname = os.path.relpath(file_path, input_path)
|
29 |
-
zipf.write(file_path, arcname=arcname)
|
30 |
-
|
31 |
-
return zip_file_path
|
32 |
-
|
33 |
-
|
34 |
-
def extract_zip(zip_file_path, output_path):
|
35 |
-
"""
|
36 |
-
Extracts the contents of a zip file to a custom output path.
|
37 |
-
|
38 |
-
Authored by ChatGPT
|
39 |
-
|
40 |
-
Args:
|
41 |
-
zip_file_path (str): The path of the zip file to be extracted.
|
42 |
-
output_path (str): The path where the zip contents will be extracted.
|
43 |
-
|
44 |
-
Returns:
|
45 |
-
str: The path of the directory where the zip contents are extracted.
|
46 |
-
"""
|
47 |
-
if not os.path.exists(zip_file_path):
|
48 |
-
raise ValueError("The specified zip file does not exist.")
|
49 |
-
|
50 |
-
with zipfile.ZipFile(zip_file_path, "r") as zipf:
|
51 |
-
zipf.extractall(output_path)
|
52 |
-
|
53 |
-
return output_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|