Update app.py
Browse files
app.py
CHANGED
|
@@ -77,10 +77,8 @@ def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[],
|
|
| 77 |
retry=False, summary=False): # repetition_penalty, top_k
|
| 78 |
|
| 79 |
print('\n\n\n')
|
| 80 |
-
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())))
|
| 81 |
-
print(
|
| 82 |
-
print(f"chatbot 1: {chatbot}")
|
| 83 |
-
print('\n')
|
| 84 |
|
| 85 |
headers = {
|
| 86 |
"Content-Type": "application/json",
|
|
@@ -89,8 +87,7 @@ def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[],
|
|
| 89 |
|
| 90 |
chat_counter = len(history) // 2
|
| 91 |
|
| 92 |
-
print(f"chat_counter - {chat_counter}")
|
| 93 |
-
print('\n\n\n')
|
| 94 |
|
| 95 |
messages = [compose_system(system_prompt)]
|
| 96 |
if chat_counter:
|
|
@@ -132,7 +129,7 @@ def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[],
|
|
| 132 |
|
| 133 |
if not summary:
|
| 134 |
history.append(inputs)
|
| 135 |
-
print(f"payload is - {payload}")
|
| 136 |
# make a POST request to the API endpoint using the requests.post method, passing in stream=True
|
| 137 |
response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|
| 138 |
# response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|
|
|
|
| 77 |
retry=False, summary=False): # repetition_penalty, top_k
|
| 78 |
|
| 79 |
print('\n\n\n')
|
| 80 |
+
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) + '\n')
|
| 81 |
+
print(f"chatbot 1: {chatbot}\n")
|
|
|
|
|
|
|
| 82 |
|
| 83 |
headers = {
|
| 84 |
"Content-Type": "application/json",
|
|
|
|
| 87 |
|
| 88 |
chat_counter = len(history) // 2
|
| 89 |
|
| 90 |
+
print(f"chat_counter - {chat_counter}\n")
|
|
|
|
| 91 |
|
| 92 |
messages = [compose_system(system_prompt)]
|
| 93 |
if chat_counter:
|
|
|
|
| 129 |
|
| 130 |
if not summary:
|
| 131 |
history.append(inputs)
|
| 132 |
+
print(f"payload is - {payload}\n")
|
| 133 |
# make a POST request to the API endpoint using the requests.post method, passing in stream=True
|
| 134 |
response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|
| 135 |
# response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|