Spaces:
Sleeping
Sleeping
tensorgirl
commited on
Update utils.py
Browse files
utils.py
CHANGED
@@ -11,6 +11,7 @@ from transformers import pipeline
|
|
11 |
from openai import OpenAI
|
12 |
from groq import Groq
|
13 |
import time
|
|
|
14 |
from openai import OpenAI
|
15 |
|
16 |
openai_key = "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"
|
@@ -126,7 +127,7 @@ def summary(input_json):
|
|
126 |
max_tokens=2000,
|
127 |
)
|
128 |
|
129 |
-
output['Long summary'] = completion.choices[0].message['content']
|
130 |
# response = client.images.generate(
|
131 |
# model="dall-e-3",
|
132 |
# prompt=headline.text,
|
|
|
11 |
from openai import OpenAI
|
12 |
from groq import Groq
|
13 |
import time
|
14 |
+
import json
|
15 |
from openai import OpenAI
|
16 |
|
17 |
openai_key = "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"
|
|
|
127 |
max_tokens=2000,
|
128 |
)
|
129 |
|
130 |
+
output['Long summary'] = json.loads(completion.choices[0].message)['content']
|
131 |
# response = client.images.generate(
|
132 |
# model="dall-e-3",
|
133 |
# prompt=headline.text,
|