Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -114,8 +114,13 @@ for t in topics.tolist():
|
|
114 |
input += " I want you to give me only one precise word that best describes the theme of this list. If I give you multiple lists, I want you to give me one word with a maj in front for each of those lists, and separate them by // (your answer should contain only one word for each, if I give you 100 lists, You give me 100 words)"
|
115 |
new_topics = "".join(gpt_predict(input))
|
116 |
nt = new_topics.split("//")
|
117 |
-
print(nt)
|
|
|
|
|
118 |
i = 0
|
|
|
|
|
|
|
119 |
for t in topics.tolist():
|
120 |
if t != -1:
|
121 |
readable_topics_dic[nt[i]] = t
|
|
|
114 |
input += " I want you to give me only one precise word that best describes the theme of this list. If I give you multiple lists, I want you to give me one word with a maj in front for each of those lists, and separate them by // (your answer should contain only one word for each, if I give you 100 lists, You give me 100 words)"
|
115 |
new_topics = "".join(gpt_predict(input))
|
116 |
nt = new_topics.split("//")
|
117 |
+
print(len(nt))
|
118 |
+
|
119 |
+
#in case chatgpt overloaded
|
120 |
i = 0
|
121 |
+
if len(nt) < len(topics.tolist()):
|
122 |
+
nt = [f"Topic {o}" for o in range(len(topics.tolist()))]
|
123 |
+
print(nt)
|
124 |
for t in topics.tolist():
|
125 |
if t != -1:
|
126 |
readable_topics_dic[nt[i]] = t
|