INNER CODE UNIT · Python

save_upload

dusty-nv/jetson-containers · packages/llm/local_llm/web/server.py:353

    def save_upload(self, payload, path):
        logging.debug(f"saving client upload to {path}")
        with open(path, 'wb') as file:
            file.write(payload)

    def send_index(self):
        return flask.render_template(self.index, **self.kwargs)
    
    @staticmethod
    def msg_type_str(type):
        if type == WebServer.MESSAGE_JSON:
            return "json"
        elif type == WebServer.MESSAGE_TEXT:
            return "text"
        elif type == WebServer.MESSAGE_BINARY:
            return "binary"
        elif type == WebServer.MESSAGE_FILE:
            return "file"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…