minemaster01 commited on
Commit
2cc90de
·
verified ·
1 Parent(s): c9abe45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -108,7 +108,7 @@ def get_word_probabilities(text):
108
  word_colors.append(color)
109
 
110
  word_probs = [float(p) for p in word_probs]
111
- return word_probs,
112
 
113
  # def get_word_classifications(text):
114
  # text = " ".join(text.split(" ")[:2048])
@@ -170,7 +170,7 @@ def setup_hf_dataset():
170
 
171
  # Main inference + logging function
172
  def infer_and_log(text_input):
173
- word_tags = get_word_probabilities(text_input)
174
  timestamp = datetime.datetime.now().isoformat()
175
  submission_id = str(uuid.uuid4())
176
 
@@ -199,8 +199,7 @@ def infer_and_log(text_input):
199
  except Exception as e:
200
  print(f"Error uploading log: {e}")
201
 
202
- return json.dumps(word_probs, indent=2)
203
-
204
 
205
  def clear_fields():
206
  return "", ""
 
108
  word_colors.append(color)
109
 
110
  word_probs = [float(p) for p in word_probs]
111
+ return word_probs, word_colors
112
 
113
  # def get_word_classifications(text):
114
  # text = " ".join(text.split(" ")[:2048])
 
170
 
171
  # Main inference + logging function
172
  def infer_and_log(text_input):
173
+ word_probs, word_colors = get_word_probabilities(text_input)
174
  timestamp = datetime.datetime.now().isoformat()
175
  submission_id = str(uuid.uuid4())
176
 
 
199
  except Exception as e:
200
  print(f"Error uploading log: {e}")
201
 
202
+ return word_colors
 
203
 
204
  def clear_fields():
205
  return "", ""