Spaces:
Running
Running
[add] readme and some tests
Browse files- README.md +1 -2
- main.py +3 -0
- pyproject.toml +3 -0
- tests/test_utils.py +17 -0
README.md
CHANGED
@@ -13,5 +13,4 @@ short_description: This project is a GUI for the gpustack/gguf-parser-go
|
|
13 |
|
14 |
# GGUF Parser Web GUI
|
15 |
|
16 |
-
This
|
17 |
-
command-line interface (CLI). If you find this project helpful, please give that a star.
|
|
|
13 |
|
14 |
# GGUF Parser Web GUI
|
15 |
|
16 |
+
This Space is a web GUI for the [gpustack/gguf-parser-go](https://github.com/gpustack/gguf-parser-go) package, designed for users who are not familiar with CLI. For more detailed output results, please consider using the original tool. If you find this GUI helpful, please give that a star.
|
|
main.py
CHANGED
@@ -52,6 +52,9 @@ if __name__ == "__main__":
|
|
52 |
os.system(f"wget {gguf_parser_url}&&chmod +x {gguf_parser}")
|
53 |
|
54 |
with gr.Blocks(title="GGUF Parser") as iface:
|
|
|
|
|
|
|
55 |
url_input = gr.Textbox(
|
56 |
label="GGUF File URL", placeholder="Enter GGUF URL", value=DEFAULT_URL
|
57 |
)
|
|
|
52 |
os.system(f"wget {gguf_parser_url}&&chmod +x {gguf_parser}")
|
53 |
|
54 |
with gr.Blocks(title="GGUF Parser") as iface:
|
55 |
+
gr.Markdown(
|
56 |
+
"This Space is a web GUI for the [gpustack/gguf-parser-go](https://github.com/gpustack/gguf-parser-go) package, designed for users who are not familiar with CLI. For more detailed output results, please consider using the original tool. If you find this GUI helpful, please give that a star."
|
57 |
+
)
|
58 |
url_input = gr.Textbox(
|
59 |
label="GGUF File URL", placeholder="Enter GGUF URL", value=DEFAULT_URL
|
60 |
)
|
pyproject.toml
CHANGED
@@ -11,6 +11,9 @@ dependencies = [
|
|
11 |
"pydantic>=2.9.2",
|
12 |
]
|
13 |
|
|
|
|
|
|
|
14 |
[tool.pylint]
|
15 |
max-line-length = 180
|
16 |
|
|
|
11 |
"pydantic>=2.9.2",
|
12 |
]
|
13 |
|
14 |
+
[tool.pytest.ini_options]
|
15 |
+
pythonpath = "."
|
16 |
+
|
17 |
[tool.pylint]
|
18 |
max-line-length = 180
|
19 |
|
tests/test_utils.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from app.utils import abbreviate_number, human_readable_size
|
2 |
+
|
3 |
+
|
4 |
+
def test_human_readable_size():
|
5 |
+
assert human_readable_size(500) == "500.00 B"
|
6 |
+
assert human_readable_size(1023) == "1023.00 B"
|
7 |
+
assert human_readable_size(1024) == "1.00 KB"
|
8 |
+
assert human_readable_size(1048576) == "1.00 MB"
|
9 |
+
assert human_readable_size(1073741824) == "1.00 GB"
|
10 |
+
|
11 |
+
|
12 |
+
def test_abbreviate_number():
|
13 |
+
assert abbreviate_number(500) == "500"
|
14 |
+
assert abbreviate_number(999) == "999"
|
15 |
+
assert abbreviate_number(1000) == "1.00 K"
|
16 |
+
assert abbreviate_number(1500000) == "1.50 M"
|
17 |
+
assert abbreviate_number(2000000000) == "2.00 B"
|