File size: 697 Bytes
2678ef5
61b2179
2678ef5
 
 
61b2179
 
 
 
 
 
 
2678ef5
 
 
 
61b2179
 
 
 
2678ef5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from pathlib import Path

import gradio as gr

GGUF_PARSER_VERSION = os.getenv("GGUF_PARSER_VERSION", "v0.12.0")
gguf_parser = Path("gguf-parser-linux-amd64")

def greet(tmp):
    # Run the gguf-parser-go binary
    gguf_parser_output = os.popen(f"./{gguf_parser} --version").read()
    return f"{gguf_parser_output}"

iface = gr.Interface(fn=greet, inputs="text", outputs="text")

if __name__ == "__main__":
    if not gguf_parser.exists():
        gguf_parser_url = f"https://github.com/gpustack/gguf-parser-go/releases/download/{GGUF_PARSER_VERSION}/gguf-parser-linux-amd64"
        os.system(f"wget {gguf_parser_url}")
        os.system(f"chmod +x {gguf_parser}")
    iface.launch()