Spaces:
Running
on
Zero
Running
on
Zero
Update repo_utils.py
Browse files- repo_utils.py +2 -6
repo_utils.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import os
|
2 |
import subprocess
|
3 |
-
from file_utils import validate_file_types, get_file_summary, read_file_content
|
4 |
|
5 |
def validate_url(url):
|
6 |
return url.startswith('https://')
|
@@ -34,15 +34,11 @@ def extract_repo_content(url, hf_token, hf_user):
|
|
34 |
|
35 |
if file_type in SUPPORTED_FILE_TYPES and file_summary["size"] <= 32 * 1024:
|
36 |
try:
|
37 |
-
|
38 |
-
content["content"] = file_content
|
39 |
-
content["summary"] = summarize_content(file_content)
|
40 |
except Exception as e:
|
41 |
content["content"] = f"Failed to read file content: {str(e)}"
|
42 |
-
content["summary"] = ""
|
43 |
else:
|
44 |
content["content"] = "File too large or binary, content not captured."
|
45 |
-
content["summary"] = ""
|
46 |
|
47 |
extracted_content.append(content)
|
48 |
|
|
|
1 |
import os
|
2 |
import subprocess
|
3 |
+
from file_utils import validate_file_types, get_file_summary, read_file_content
|
4 |
|
5 |
def validate_url(url):
|
6 |
return url.startswith('https://')
|
|
|
34 |
|
35 |
if file_type in SUPPORTED_FILE_TYPES and file_summary["size"] <= 32 * 1024:
|
36 |
try:
|
37 |
+
content["content"] = read_file_content(file_path)
|
|
|
|
|
38 |
except Exception as e:
|
39 |
content["content"] = f"Failed to read file content: {str(e)}"
|
|
|
40 |
else:
|
41 |
content["content"] = "File too large or binary, content not captured."
|
|
|
42 |
|
43 |
extracted_content.append(content)
|
44 |
|