Spaces:
Running
Running
Added more pricing guards
Browse files
app.py
CHANGED
@@ -96,8 +96,8 @@ def download_repo(gh_repo, data, openai_api_key, pbar=gr.Progress()):
|
|
96 |
text = z.read(f).decode('utf-8')
|
97 |
except UnicodeDecodeError:
|
98 |
continue
|
99 |
-
# check if it's bigger than
|
100 |
-
if len(text) >
|
101 |
continue
|
102 |
# have to save to temporary file so we have a path
|
103 |
with tempfile.NamedTemporaryFile(delete=False) as tmp:
|
|
|
96 |
text = z.read(f).decode('utf-8')
|
97 |
except UnicodeDecodeError:
|
98 |
continue
|
99 |
+
# check if it's bigger than 100kb or smaller than 10 bytes
|
100 |
+
if len(text) > 1e5 or len(text) < 10:
|
101 |
continue
|
102 |
# have to save to temporary file so we have a path
|
103 |
with tempfile.NamedTemporaryFile(delete=False) as tmp:
|