Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ MODEL = "gpt-3.5-turbo"
|
|
| 8 |
API_URL = os.getenv("API_URL")
|
| 9 |
DISABLED = os.getenv("DISABLED") == 'True'
|
| 10 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
| 11 |
-
NUM_THREADS =
|
| 12 |
|
| 13 |
print (NUM_THREADS)
|
| 14 |
|
|
@@ -63,7 +63,7 @@ def predict(inputs, top_p, temperature, chat_counter, chatbot, history, request:
|
|
| 63 |
messages.append(message)
|
| 64 |
|
| 65 |
message = {}
|
| 66 |
-
message["role"] = "user"
|
| 67 |
message["content"] = inputs
|
| 68 |
messages.append(message)
|
| 69 |
payload = {
|
|
@@ -80,8 +80,8 @@ def predict(inputs, top_p, temperature, chat_counter, chatbot, history, request:
|
|
| 80 |
chat_counter += 1
|
| 81 |
|
| 82 |
history.append(inputs)
|
| 83 |
-
token_counter = 0
|
| 84 |
-
partial_words = ""
|
| 85 |
counter = 0
|
| 86 |
|
| 87 |
try:
|
|
|
|
| 8 |
API_URL = os.getenv("API_URL")
|
| 9 |
DISABLED = os.getenv("DISABLED") == 'True'
|
| 10 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
| 11 |
+
NUM_THREADS = int(os.getenv("NUM_THREADS"))
|
| 12 |
|
| 13 |
print (NUM_THREADS)
|
| 14 |
|
|
|
|
| 63 |
messages.append(message)
|
| 64 |
|
| 65 |
message = {}
|
| 66 |
+
message["role"] = "user"
|
| 67 |
message["content"] = inputs
|
| 68 |
messages.append(message)
|
| 69 |
payload = {
|
|
|
|
| 80 |
chat_counter += 1
|
| 81 |
|
| 82 |
history.append(inputs)
|
| 83 |
+
token_counter = 0
|
| 84 |
+
partial_words = ""
|
| 85 |
counter = 0
|
| 86 |
|
| 87 |
try:
|