Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -104,12 +104,13 @@ def gpt_predict(inputs, request:gr.Request=gr.State([]), top_p = 1, temperature
|
|
104 |
readable_topics_dic = dict()
|
105 |
readable_topics = []
|
106 |
for t in topics.tolist():
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
113 |
print(readable_topics)
|
114 |
|
115 |
|
|
|
104 |
readable_topics_dic = dict()
|
105 |
readable_topics = []
|
106 |
for t in topics.tolist():
|
107 |
+
if t != -1:
|
108 |
+
selected_data = df[df['topic'] == t]
|
109 |
+
keywords = selected_data['keywords'][selected_data.index[0]]
|
110 |
+
input = "With an answer of only few words (less than 5) give me a word or expression that charaterise the best this set of words as if it was the description of a theme: " + str(keywords)
|
111 |
+
new_topic = "".join(gpt_predict(input))
|
112 |
+
readable_topics += new_topic
|
113 |
+
readable_topics_dic[new_topic] = t
|
114 |
print(readable_topics)
|
115 |
|
116 |
|