Update app.py
Browse files
app.py
CHANGED
@@ -486,18 +486,7 @@ def filecreate(x,subject,total):
|
|
486 |
|
487 |
else:
|
488 |
generated = generate_question(text,subject, total)
|
489 |
-
# return text
|
490 |
-
# mycursor = mydb.cursor()
|
491 |
|
492 |
-
# timedate= datetime.datetime.now()
|
493 |
-
|
494 |
-
# sql = "INSERT INTO mcqsfiles (subject, input, output, timedate) VALUES (%s,%s, %s,%s)"
|
495 |
-
# val = (subject, text, generated, timedate)
|
496 |
-
# mycursor.execute(sql, val)
|
497 |
-
|
498 |
-
# mydb.commit()
|
499 |
-
|
500 |
-
# print(mycursor.rowcount, "record inserted.")
|
501 |
|
502 |
return generated
|
503 |
|
@@ -506,7 +495,7 @@ def filecreate(x,subject,total):
|
|
506 |
import gradio as gr
|
507 |
|
508 |
context = gr.HTML(label="Text")
|
509 |
-
file = gr.File(label="Upload your file
|
510 |
total = gr.Slider(1,10, value=1,step=1, label="Total Number Of Questions")
|
511 |
subject = gr.Textbox(placeholder="Enter subject/title here...", label="Enter your title (title must contain 1 word).")
|
512 |
|
|
|
486 |
|
487 |
else:
|
488 |
generated = generate_question(text,subject, total)
|
|
|
|
|
489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
|
491 |
return generated
|
492 |
|
|
|
495 |
import gradio as gr
|
496 |
|
497 |
context = gr.HTML(label="Text")
|
498 |
+
file = gr.File(label="Upload your *.txt file (File must contain more than 150 words).")
|
499 |
total = gr.Slider(1,10, value=1,step=1, label="Total Number Of Questions")
|
500 |
subject = gr.Textbox(placeholder="Enter subject/title here...", label="Enter your title (title must contain 1 word).")
|
501 |
|