浏览代码

feat: save the book temporarily for chatting feature

Young Han 1 周之前
父节点
当前提交
82e72ff8f2
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      end-to-end-use-cases/long_context/book-character-mindmap/server/server.py

+ 3 - 0
end-to-end-use-cases/long_context/book-character-mindmap/server/server.py

@@ -167,6 +167,9 @@ def inference():
         # Read file content directly from the uploaded file
         file_content = file.read().decode("utf-8")
 
+        with open("book.txt", "w") as f:
+            f.write(file_content)
+
         # Calculate the number of input tokens
         num_input_tokens = calculate_input_tokens(file_content)