Kaengbold commited on
Commit
6f8b104
·
1 Parent(s): 2e71080

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -8,7 +8,7 @@ from sumy.summarizers.lsa import LsaSummarizer as Summarizer
8
  from sumy.nlp.stemmers import Stemmer
9
  from sumy.utils import get_stop_words
10
  import gradio as gr
11
- import csv
12
 
13
 
14
  def maker(api_key, mode, input_text,detail,Spend_input_data_API_key_is_not_safed):
@@ -145,10 +145,8 @@ def maker(api_key, mode, input_text,detail,Spend_input_data_API_key_is_not_safed
145
  out = concept_card_maker(api_key, input_text,detail,Spend_input_data_API_key_is_not_safed)
146
 
147
  if Spend_input_data_API_key_is_not_safed == True:
148
- with open('\concept_data.csv', 'w', newline='') as csvfile:
149
- writer = csv.writer(csvfile)
150
- writer.writerows([input_text,out,"concept"])
151
- print("test")
152
 
153
  return out
154
 
@@ -173,10 +171,8 @@ def maker(api_key, mode, input_text,detail,Spend_input_data_API_key_is_not_safed
173
  listsummery = str(listsummery).replace('\n '," \n")
174
  out = f"{listsummery}"
175
  if Spend_input_data_API_key_is_not_safed == True:
176
- with open('\\flashcard_data.csv', 'w', newline='') as csvfile:
177
- writer = csv.writer(csvfile)
178
-
179
- writer.writerows([input_text,out])
180
 
181
  return out
182
 
 
8
  from sumy.nlp.stemmers import Stemmer
9
  from sumy.utils import get_stop_words
10
  import gradio as gr
11
+
12
 
13
 
14
  def maker(api_key, mode, input_text,detail,Spend_input_data_API_key_is_not_safed):
 
145
  out = concept_card_maker(api_key, input_text,detail,Spend_input_data_API_key_is_not_safed)
146
 
147
  if Spend_input_data_API_key_is_not_safed == True:
148
+ with open('\concept_data.txt', 'w', newline='') as f:
149
+ f.write([input_text,out,"concept"])
 
 
150
 
151
  return out
152
 
 
171
  listsummery = str(listsummery).replace('\n '," \n")
172
  out = f"{listsummery}"
173
  if Spend_input_data_API_key_is_not_safed == True:
174
+ with open('\\flashcard_data.csv', 'w', newline='') as f:
175
+ f.write([input_text,out])
 
 
176
 
177
  return out
178