Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for loads (0.17 sec)

  1. tests/test_ws_dependencies.py

    def test_index():
        client = TestClient(app)
        with client.websocket_connect("/") as websocket:
            data = json.loads(websocket.receive_text())
            assert data == ["app", "index"]
    
    
    def test_routerindex():
        client = TestClient(app)
        with client.websocket_connect("/router") as websocket:
            data = json.loads(websocket.receive_text())
            assert data == ["app", "router2", "router", "routerindex"]
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 20:35:39 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  2. docs/en/docs/deployment/concepts.md

    ### Server Memory
    
    For example, if your code loads a Machine Learning model with **1 GB in size**, when you run one process with your API, it will consume at least 1 GB of RAM. And if you start **4 processes** (4 workers), each will consume 1 GB of RAM. So in total, your API will consume **4 GB of RAM**.
    
    And if your remote server or virtual machine only has 3 GB of RAM, trying to load more than 4 GB of RAM will cause problems. 🚨
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18K bytes
    - Viewed (0)
  3. docs_src/generate_clients/tutorial004.py

    import json
    from pathlib import Path
    
    file_path = Path("./openapi.json")
    openapi_content = json.loads(file_path.read_text())
    
    for path_data in openapi_content["paths"].values():
        for operation in path_data.values():
            tag = operation["tags"][0]
            operation_id = operation["operationId"]
            to_remove = f"{tag}-"
            new_operation_id = operation_id[len(to_remove) :]
            operation["operationId"] = new_operation_id
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 04 22:02:18 GMT 2022
    - 493 bytes
    - Viewed (0)
  4. fastapi/openapi/docs.py

            Doc(
                """
                Load and use Google Fonts.
                """
            ),
        ] = True,
    ) -> HTMLResponse:
        """
        Generate and return the HTML response that loads ReDoc for the alternative
        API docs (normally served at `/redoc`).
    
        You would only call this function yourself if you needed to override some parts,
        for example the URLs to use to load ReDoc's JavaScript and CSS.
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body/test_tutorial001_py310.py

                        "type": "type_error.dict",
                    }
                ]
            }
        )
    
    
    @needs_py310
    def test_other_exceptions(client: TestClient):
        with patch("json.loads", side_effect=Exception):
            response = client.post("/items/", json={"test": "test2"})
            assert response.status_code == 400, response.text
    
    
    @needs_py310
    def test_openapi_schema(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (1)
  6. tests/test_tutorial/test_body/test_tutorial001.py

                        "type": "type_error.dict",
                    }
                ]
            }
        )
    
    
    def test_other_exceptions(client: TestClient):
        with patch("json.loads", side_effect=Exception):
            response = client.post("/items/", json={"test": "test2"})
            assert response.status_code == 400, response.text
    
    
    def test_openapi_schema(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (5)
  7. docs/en/docs/index.md

    Used by FastAPI / Starlette:
    
    * <a href="https://www.uvicorn.org" target="_blank"><code>uvicorn</code></a> - for the server that loads and serves your application.
    * <a href="https://github.com/ijl/orjson" target="_blank"><code>orjson</code></a> - Required if you want to use `ORJSONResponse`.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 23:58:47 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  8. tests/test_dependency_contextmanager.py

        response = client.get("/context_b_bg")
        data = response.json()
        assert data["context_b"] == "started b"
        assert data["context_a"] == "started a"
        assert data["bg"] == "not set"
        middleware_state = json.loads(response.headers["x-state"])
        assert middleware_state["context_b"] == "finished b with a: started a"
        assert middleware_state["context_a"] == "finished a"
        assert middleware_state["bg"] == "not set"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  9. docs/pt/docs/deployment.md

    ### Traefik
    
    <a href="https://traefik.io/" class="external-link" target="_blank">Traefik</a> é um _proxy_ reverso / _load balancer_ de alta performance. Ele pode fazer o trabalho do _"TLS Termination Proxy"_ (à parte de outros recursos).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Aug 18 16:16:54 GMT 2022
    - 16.8K bytes
    - Viewed (0)
  10. docs/en/docs/release-notes.md

    from fastapi import FastAPI
    
    
    def fake_answer_to_everything_ml_model(x: float):
        return x * 42
    
    
    ml_models = {}
    
    
    @asynccontextmanager
    async def lifespan(app: FastAPI):
        # Load the ML model
        ml_models["answer_to_everything"] = fake_answer_to_everything_ml_model
        yield
        # Clean up the ML models and release the resources
        ml_models.clear()
    
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Apr 28 00:28:00 GMT 2024
    - 385.5K bytes
    - Viewed (1)
Back to top