Talip7 commited on
Commit
672b965
·
verified ·
1 Parent(s): 154f92d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -15,7 +15,7 @@ LANGUAGE_CODES = {
15
  "French": "fr",
16
  "German": "de",
17
  "Spanish": "es",
18
- "Arabic": "ar"
19
  }
20
 
21
  QUIZ_TITLES = {
@@ -124,18 +124,20 @@ Powered by OpenAI GPT-3.5 and Gradio.
124
  ''')
125
 
126
  with gr.Row():
127
- summary_lang = gr.Dropdown(LANGUAGES, value="English", label="Summary Language")
128
- summary_style = gr.Dropdown(SUMMARY_STYLES, value="Academic", label="Summary Style")
129
- char_limit = gr.Textbox(label="Character Limit", value="300")
 
130
 
131
- make_quiz = gr.Checkbox(label="Generate Quiz Questions", value=True)
 
132
 
133
- with gr.Row():
134
- text_input = gr.Textbox(lines=6, label="Text Input")
135
- pdf_file = gr.File(label="Or Upload PDF")
136
 
137
- output = gr.Textbox(label="Output", lines=20)
138
- btn = gr.Button("Summarize")
139
- btn.click(process, [text_input, pdf_file, summary_lang, summary_style, char_limit, make_quiz], output)
 
 
140
 
141
- demo.launch()
 
15
  "French": "fr",
16
  "German": "de",
17
  "Spanish": "es",
18
+ "Arabic": "ar"
19
  }
20
 
21
  QUIZ_TITLES = {
 
124
  ''')
125
 
126
  with gr.Row():
127
+ with gr.Column(scale=2):
128
+ text_input = gr.Textbox(label="Text Input", lines=15)
129
+ with gr.Column(scale=2):
130
+ pdf_file = gr.File(label="Or Upload PDF", file_types=[".pdf"])
131
 
132
+ # Output küçük kutu
133
+ output = gr.Textbox(label="Output", lines=7)
134
 
135
+ run_btn = gr.Button("Summarize")
 
 
136
 
137
+ run_btn.click(
138
+ fn=analyze_input,
139
+ inputs=[summary_lang, summary_style, char_limit, text_input, pdf_file, generate_quiz],
140
+ outputs=output
141
+ )
142
 
143
+ demo.launch()