Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -142,11 +142,13 @@ def maker(api_key, mode, input_text,detail,Spend_input_data_API_key_is_not_safed
|
|
142 |
if mode == "flashcards":
|
143 |
catorgizer = 0
|
144 |
if mode == "concepts cards":
|
145 |
-
|
146 |
-
|
147 |
-
|
|
|
148 |
writer = csv.writer(csvfile)
|
149 |
-
writer.writerows([input_text,out])
|
|
|
150 |
|
151 |
return out
|
152 |
|
@@ -171,7 +173,7 @@ def maker(api_key, mode, input_text,detail,Spend_input_data_API_key_is_not_safed
|
|
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', '
|
175 |
writer = csv.writer(csvfile)
|
176 |
|
177 |
writer.writerows([input_text,out])
|
@@ -189,9 +191,11 @@ iface =gr.Interface(fn = maker, allow_flagging= "never", inputs=
|
|
189 |
gr.Textbox( label = "Input Text", lines=10, placeholder="Enter your text here..."),
|
190 |
gr.Dropdown(["No summersiation", "low summersation", "medium summersation", "high summersation"]),
|
191 |
gr.Checkbox(value = True)
|
|
|
192 |
],
|
193 |
outputs = "text", title = "Study cards maker", description= "This tool uses openAI GPT-3 to make study cards for you. This include flashcards, super usefull for Remnotes(reday to copy past). Please use yoru Openai api key. Which you get by sining up at https://beta.openai.com/ "
|
194 |
)
|
195 |
|
|
|
196 |
if __name__ == "__main__":
|
197 |
iface.launch()
|
|
|
142 |
if mode == "flashcards":
|
143 |
catorgizer = 0
|
144 |
if mode == "concepts cards":
|
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 |
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])
|
|
|
191 |
gr.Textbox( label = "Input Text", lines=10, placeholder="Enter your text here..."),
|
192 |
gr.Dropdown(["No summersiation", "low summersation", "medium summersation", "high summersation"]),
|
193 |
gr.Checkbox(value = True)
|
194 |
+
|
195 |
],
|
196 |
outputs = "text", title = "Study cards maker", description= "This tool uses openAI GPT-3 to make study cards for you. This include flashcards, super usefull for Remnotes(reday to copy past). Please use yoru Openai api key. Which you get by sining up at https://beta.openai.com/ "
|
197 |
)
|
198 |
|
199 |
+
|
200 |
if __name__ == "__main__":
|
201 |
iface.launch()
|