cotxetj commited on
Commit
fefa610
1 Parent(s): f614b8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- selected_data = df[df['topic'] == t]
108
- keywords = selected_data['keywords'][selected_data.index[0]]
109
- 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)
110
- new_topic = gpt_predict(input).join()
111
- readable_topics += new_topic
112
- readable_topics_dic[new_topic] = t
 
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