Spaces:
Sleeping
Sleeping
Commit
·
cfc7e6f
1
Parent(s):
1533b46
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import os
|
|
5 |
os.environ["OPENAI_API_KEY"] = "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"
|
6 |
model_name = "gpt-3.5-turbo"
|
7 |
LLM = OpenAI(model_name=model_name, temperature=0.1)
|
8 |
-
qa_data_file_path='
|
9 |
import json
|
10 |
def save_qa_data(qa_data, file_path):
|
11 |
with open(file_path, 'w', encoding='utf-8') as f:
|
@@ -47,7 +47,7 @@ def chat(
|
|
47 |
history_messages = state
|
48 |
if history_messages == None:
|
49 |
history_messages = []
|
50 |
-
history_messages.append({"role": "system", "content":
|
51 |
|
52 |
history_messages.append({"role": "user", "content": message})
|
53 |
# We have no content for the assistant's response yet but we will update this:
|
|
|
5 |
os.environ["OPENAI_API_KEY"] = "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"
|
6 |
model_name = "gpt-3.5-turbo"
|
7 |
LLM = OpenAI(model_name=model_name, temperature=0.1)
|
8 |
+
qa_data_file_path=os.getcwd()+'qa.txt'
|
9 |
import json
|
10 |
def save_qa_data(qa_data, file_path):
|
11 |
with open(file_path, 'w', encoding='utf-8') as f:
|
|
|
47 |
history_messages = state
|
48 |
if history_messages == None:
|
49 |
history_messages = []
|
50 |
+
history_messages.append({"role": "system", "content": qa_data_file_path})
|
51 |
|
52 |
history_messages.append({"role": "user", "content": message})
|
53 |
# We have no content for the assistant's response yet but we will update this:
|