Spaces:
Runtime error
Runtime error
debug
Browse files
app.py
CHANGED
|
@@ -77,10 +77,10 @@ def predict_chatgpt(inputs, top_p_chatgpt, temperature_chatgpt, openai_api_key,
|
|
| 77 |
print("*************************************")
|
| 78 |
print(chunk)
|
| 79 |
print("*************************************")
|
| 80 |
-
print(json.loads(chunk[6:]))
|
| 81 |
-
print("*************************************")
|
| 82 |
# decode each line as response data is in bytes
|
| 83 |
if len(chunk) > 13 and "content" in json.loads(chunk[6:])['choices'][0]["delta"]:
|
|
|
|
|
|
|
| 84 |
partial_words = partial_words + json.loads(chunk[6:])['choices'][0]["delta"]["content"]
|
| 85 |
if token_counter == 0:
|
| 86 |
history.append(" " + partial_words)
|
|
|
|
| 77 |
print("*************************************")
|
| 78 |
print(chunk)
|
| 79 |
print("*************************************")
|
|
|
|
|
|
|
| 80 |
# decode each line as response data is in bytes
|
| 81 |
if len(chunk) > 13 and "content" in json.loads(chunk[6:])['choices'][0]["delta"]:
|
| 82 |
+
print(json.loads(chunk[6:]))
|
| 83 |
+
print("*************************************")
|
| 84 |
partial_words = partial_words + json.loads(chunk[6:])['choices'][0]["delta"]["content"]
|
| 85 |
if token_counter == 0:
|
| 86 |
history.append(" " + partial_words)
|