Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	Commit 
							
							ยท
						
						d1cb523
	
1
								Parent(s):
							
							7724866
								
add tgi
Browse files- app.py +5 -2
 - config_store.py +7 -4
 - requirements.txt +1 -0
 
    	
        app.py
    CHANGED
    
    | 
         @@ -8,20 +8,21 @@ from run import run_benchmark 
     | 
|
| 8 | 
         
             
            from config_store import (
         
     | 
| 9 | 
         
             
                get_training_config,
         
     | 
| 10 | 
         
             
                get_inference_config,
         
     | 
| 
         | 
|
| 11 | 
         
             
                get_neural_compressor_config,
         
     | 
| 12 | 
         
             
                get_onnxruntime_config,
         
     | 
| 13 | 
         
             
                get_openvino_config,
         
     | 
| 14 | 
         
             
                get_pytorch_config,
         
     | 
| 15 | 
         
             
            )
         
     | 
| 16 | 
         | 
| 17 | 
         
            -
            BACKENDS = ["pytorch", "onnxruntime", "openvino", "neural-compressor"]
         
     | 
| 18 | 
         
             
            BENCHMARKS = ["inference", "training"]
         
     | 
| 19 | 
         
             
            DEVICES = ["cpu", "cuda"]
         
     | 
| 20 | 
         | 
| 21 | 
         | 
| 22 | 
         
             
            with gr.Blocks() as demo:
         
     | 
| 23 | 
         
             
                # title text
         
     | 
| 24 | 
         
            -
                gr.HTML("<h1 style='text-align: center'>๐ค Optimum-Benchmark UI 
     | 
| 25 | 
         
             
                # explanation text
         
     | 
| 26 | 
         
             
                gr.Markdown(
         
     | 
| 27 | 
         
             
                    "This is a demo space of [Optimum-Benchmark](https://github.com/huggingface/optimum-benchmark.git):"
         
     | 
| 
         @@ -72,6 +73,8 @@ with gr.Blocks() as demo: 
     | 
|
| 72 | 
         
             
                                openvino_config = get_openvino_config()
         
     | 
| 73 | 
         
             
                            with gr.Accordion(label="Neural Compressor Config", open=False, visible=False):
         
     | 
| 74 | 
         
             
                                neural_compressor_config = get_neural_compressor_config()
         
     | 
| 
         | 
|
| 
         | 
|
| 75 | 
         | 
| 76 | 
         
             
                    # hide backend configs based on backend
         
     | 
| 77 | 
         
             
                    backend.change(
         
     | 
| 
         | 
|
| 8 | 
         
             
            from config_store import (
         
     | 
| 9 | 
         
             
                get_training_config,
         
     | 
| 10 | 
         
             
                get_inference_config,
         
     | 
| 11 | 
         
            +
                get_text_generation_inference_config,
         
     | 
| 12 | 
         
             
                get_neural_compressor_config,
         
     | 
| 13 | 
         
             
                get_onnxruntime_config,
         
     | 
| 14 | 
         
             
                get_openvino_config,
         
     | 
| 15 | 
         
             
                get_pytorch_config,
         
     | 
| 16 | 
         
             
            )
         
     | 
| 17 | 
         | 
| 18 | 
         
            +
            BACKENDS = ["pytorch", "onnxruntime", "openvino", "neural-compressor", "text-generation-inference"]
         
     | 
| 19 | 
         
             
            BENCHMARKS = ["inference", "training"]
         
     | 
| 20 | 
         
             
            DEVICES = ["cpu", "cuda"]
         
     | 
| 21 | 
         | 
| 22 | 
         | 
| 23 | 
         
             
            with gr.Blocks() as demo:
         
     | 
| 24 | 
         
             
                # title text
         
     | 
| 25 | 
         
            +
                gr.HTML("<h1 style='text-align: center'>๐ค Optimum-Benchmark UI ๐๏ธ</h1>")
         
     | 
| 26 | 
         
             
                # explanation text
         
     | 
| 27 | 
         
             
                gr.Markdown(
         
     | 
| 28 | 
         
             
                    "This is a demo space of [Optimum-Benchmark](https://github.com/huggingface/optimum-benchmark.git):"
         
     | 
| 
         | 
|
| 73 | 
         
             
                                openvino_config = get_openvino_config()
         
     | 
| 74 | 
         
             
                            with gr.Accordion(label="Neural Compressor Config", open=False, visible=False):
         
     | 
| 75 | 
         
             
                                neural_compressor_config = get_neural_compressor_config()
         
     | 
| 76 | 
         
            +
                            with gr.Accordion(label="Text Generation Inference Config", open=False, visible=False):
         
     | 
| 77 | 
         
            +
                                text_generation_inference_config = get_text_generation_inference_config()
         
     | 
| 78 | 
         | 
| 79 | 
         
             
                    # hide backend configs based on backend
         
     | 
| 80 | 
         
             
                    backend.change(
         
     | 
    	
        config_store.py
    CHANGED
    
    | 
         @@ -114,9 +114,7 @@ def get_pytorch_config(): 
     | 
|
| 114 | 
         | 
| 115 | 
         
             
            def get_onnxruntime_config():
         
     | 
| 116 | 
         
             
                return get_base_backend_config(backend_name="onnxruntime")
         
     | 
| 117 | 
         
            -
             
     | 
| 118 | 
         
            -
             
     | 
| 119 | 
         
            -
             
     | 
| 120 | 
         | 
| 121 | 
         
             
                # no_weights: bool = False
         
     | 
| 122 | 
         | 
| 
         @@ -169,12 +167,17 @@ def get_onnxruntime_config(): 
     | 
|
| 169 | 
         
             
                # peft_strategy: Optional[str] = None
         
     | 
| 170 | 
         
             
                # peft_config: Dict[str, Any] = field(default_factory=dict)
         
     | 
| 171 | 
         | 
| 
         | 
|
| 172 | 
         
             
            def get_openvino_config():
         
     | 
| 173 | 
         
             
                return get_base_backend_config(backend_name="openvino")
         
     | 
| 174 | 
         | 
| 175 | 
         | 
| 176 | 
         
             
            def get_neural_compressor_config():
         
     | 
| 177 | 
         
            -
                return get_base_backend_config(backend_name=" 
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 178 | 
         | 
| 179 | 
         | 
| 180 | 
         
             
            def get_inference_config():
         
     | 
| 
         | 
|
| 114 | 
         | 
| 115 | 
         
             
            def get_onnxruntime_config():
         
     | 
| 116 | 
         
             
                return get_base_backend_config(backend_name="onnxruntime")
         
     | 
| 117 | 
         
            +
                # no_weights
         
     | 
| 
         | 
|
| 
         | 
|
| 118 | 
         | 
| 119 | 
         
             
                # no_weights: bool = False
         
     | 
| 120 | 
         | 
| 
         | 
|
| 167 | 
         
             
                # peft_strategy: Optional[str] = None
         
     | 
| 168 | 
         
             
                # peft_config: Dict[str, Any] = field(default_factory=dict)
         
     | 
| 169 | 
         | 
| 170 | 
         
            +
             
     | 
| 171 | 
         
             
            def get_openvino_config():
         
     | 
| 172 | 
         
             
                return get_base_backend_config(backend_name="openvino")
         
     | 
| 173 | 
         | 
| 174 | 
         | 
| 175 | 
         
             
            def get_neural_compressor_config():
         
     | 
| 176 | 
         
            +
                return get_base_backend_config(backend_name="neural-compressor")
         
     | 
| 177 | 
         
            +
             
     | 
| 178 | 
         
            +
             
     | 
| 179 | 
         
            +
            def get_text_generation_inference_config():
         
     | 
| 180 | 
         
            +
                return get_base_backend_config(backend_name="text-generation-inference")
         
     | 
| 181 | 
         | 
| 182 | 
         | 
| 183 | 
         
             
            def get_inference_config():
         
     | 
    	
        requirements.txt
    CHANGED
    
    | 
         @@ -1,3 +1,4 @@ 
     | 
|
| 1 | 
         
             
            gradio==3.41
         
     | 
| 
         | 
|
| 2 | 
         
             
            ansi2html==1.8.0
         
     | 
| 3 | 
         
             
            optimum-benchmark[onnxruntime,openvino,neural-compressor,diffusers,peft]@git+https://github.com/huggingface/optimum-benchmark.git
         
     | 
| 
         | 
|
| 1 | 
         
             
            gradio==3.41
         
     | 
| 2 | 
         
            +
            docker==6.1.3
         
     | 
| 3 | 
         
             
            ansi2html==1.8.0
         
     | 
| 4 | 
         
             
            optimum-benchmark[onnxruntime,openvino,neural-compressor,diffusers,peft]@git+https://github.com/huggingface/optimum-benchmark.git
         
     |