Spaces:
Runtime error
Runtime error
debug
Browse files
app.py
CHANGED
|
@@ -74,6 +74,11 @@ def predict_chatgpt(inputs, top_p_chatgpt, temperature_chatgpt, openai_api_key,
|
|
| 74 |
# check whether each line is non-empty
|
| 75 |
if chunk.decode() :
|
| 76 |
chunk = chunk.decode()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
# decode each line as response data is in bytes
|
| 78 |
if len(chunk) > 12 and "content" in json.loads(chunk[6:])['choices'][0]["delta"]:
|
| 79 |
partial_words = partial_words + json.loads(chunk[6:])['choices'][0]["delta"]["content"]
|
|
|
|
| 74 |
# check whether each line is non-empty
|
| 75 |
if chunk.decode() :
|
| 76 |
chunk = chunk.decode()
|
| 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) > 12 and "content" in json.loads(chunk[6:])['choices'][0]["delta"]:
|
| 84 |
partial_words = partial_words + json.loads(chunk[6:])['choices'][0]["delta"]["content"]
|