Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	
		unfinity
		
	commited on
		
		
					Commit 
							
							·
						
						883b8b9
	
1
								Parent(s):
							
							0eeb953
								
test
Browse files- Dockerfile +1 -1
- api.py +3 -3
- test.py +7 -0
    	
        Dockerfile
    CHANGED
    
    | @@ -22,4 +22,4 @@ COPY . /app | |
| 22 |  | 
| 23 | 
             
            USER root
         | 
| 24 | 
             
            EXPOSE 7860
         | 
| 25 | 
            -
            CMD uvicorn  | 
|  | |
| 22 |  | 
| 23 | 
             
            USER root
         | 
| 24 | 
             
            EXPOSE 7860
         | 
| 25 | 
            +
            CMD uvicorn test:app --port 7860 --host 0.0.0.0
         | 
    	
        api.py
    CHANGED
    
    | @@ -58,6 +58,6 @@ async def predict_image(file: UploadFile = File(...)): | |
| 58 | 
             
                return JSONResponse(content=json_data)
         | 
| 59 |  | 
| 60 |  | 
| 61 | 
            -
            if __name__ == "__main__":
         | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
|  | |
| 58 | 
             
                return JSONResponse(content=json_data)
         | 
| 59 |  | 
| 60 |  | 
| 61 | 
            +
            # if __name__ == "__main__":
         | 
| 62 | 
            +
            #     import uvicorn
         | 
| 63 | 
            +
            #     uvicorn.run(app, host="0.0.0.0", port=7860)
         | 
    	
        test.py
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            from fastapi import FastAPI
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            app = FastAPI()
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            @app.get("/")
         | 
| 6 | 
            +
            def read_root():
         | 
| 7 | 
            +
                return {"Hello": "World!"}
         |