Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Create app.py
Browse files
    	
        app.py
    ADDED
    
    | @@ -0,0 +1,9 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            import gradio as gr
         | 
| 2 | 
            +
            from transformers import pipeline
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            title = "Document Classifier"
         | 
| 5 | 
            +
            description = "This machine has vision. It can read an image of a document and attempt to identify the text type of the document. To test the machine, upload or drop an image of a document, submit and read the results. The results comprise a list of text types that the machine predicts is in the image. Beside a text type, the length of the bar indicates the confidence with which the machine sees the text type. The longer the bar, the more confident the machine is.
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            pipe = pipeline(task='image-classification', model = "microsoft/dit-base-finetuned-rvlcdip")
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            gr.Interface.from_pipeline(pipe, title=title, description=description, enable_queue=True).launch()
         | 
