Bre*_*ill 26 openai-api chatgpt-api
我们有一个 ChatGPT 的用例,用于总结长文本(语音到文本的对话可能超过一个小时)。
然而,我们发现 4k 令牌限制往往会导致输入文本由于令牌限制而被截断为一半左右。
零件加工似乎没有保留以前零件的历史。
对于提交超过 4k 代币的较长请求,我们有哪些选项?
最接近您问题的答案将以Embeddings的形式出现。
您可以在这里找到它们的概述。
我建议您从 OpenAI Cookbook Github 页面查看此代码,该页面使用网络爬行问答示例来解释嵌入。
我使用了第 5 步以后的代码,并更改了文本的位置,将其指向包含长文本的文件。
从:
# Open the file and read the text
with open("text/" + domain + "/" + file, "r", encoding="UTF-8") as f:
text = f.read()
Run Code Online (Sandbox Code Playgroud)
到:
# Open the file and read the text
with open("/my_location/long_text_file.txt", "r", encoding="UTF-8") as f:
text = f.read()
Run Code Online (Sandbox Code Playgroud)
并将第 13 步的问题修改为我需要了解的有关文本的内容。
| 归档时间: |
|
| 查看次数: |
38136 次 |
| 最近记录: |