Spaces:
son9john
/
Runtime error

son9john commited on
Commit
4bda5f9
·
1 Parent(s): c2796c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -76,6 +76,12 @@ def colorize_and_update(system_message, submit_update):
76
 
77
  def update_text_output(system_message, submit_update):
78
  submit_update(system_message['content'], None)
 
 
 
 
 
 
79
 
80
 
81
  def transcribe(audio, text):
@@ -86,6 +92,7 @@ def transcribe(audio, text):
86
 
87
  # Check if the first word of the first line is "COLORIZE"
88
  if text and text.split("\n")[0].split(" ")[0].strip().upper() == "COLORIZE":
 
89
  colorized_input = colorize_text(text)
90
  return text, colorized_input
91
 
 
76
 
77
  def update_text_output(system_message, submit_update):
78
  submit_update(system_message['content'], None)
79
+
80
+ def train(text):
81
+ now_et = datetime.now(timezone(timedelta(hours=-4)))
82
+ published_date = now_et.strftime('%m-%d-%y %H:%M')
83
+ df = pd.DataFrame([text])
84
+ notion_df.upload(df, 'https://www.notion.so/US-62e861a0b35f43da8ef9a7789512b8c2?pvs=4', title=str(published_date), api_key=API_KEY)
85
 
86
 
87
  def transcribe(audio, text):
 
92
 
93
  # Check if the first word of the first line is "COLORIZE"
94
  if text and text.split("\n")[0].split(" ")[0].strip().upper() == "COLORIZE":
95
+ train(text)
96
  colorized_input = colorize_text(text)
97
  return text, colorized_input
98