Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -209,19 +209,32 @@ def predict_opinion(excel_file: gr.File):
|
|
| 209 |
with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as demo:
|
| 210 |
gr.Markdown("# Denetçi Görüşü Tahmin Uygulaması")
|
| 211 |
|
|
|
|
| 212 |
with gr.Row():
|
| 213 |
-
file_in = gr.File(
|
| 214 |
-
|
|
|
|
|
|
|
|
|
|
| 215 |
|
|
|
|
| 216 |
gr.Examples(
|
| 217 |
examples=EXAMPLE_XLSX,
|
| 218 |
inputs=file_in,
|
| 219 |
-
label="Örnek Dosyayı Deneyin",
|
| 220 |
cache_examples=False,
|
| 221 |
)
|
| 222 |
|
| 223 |
-
|
| 224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
if __name__ == "__main__":
|
| 227 |
demo.launch()
|
|
|
|
| 209 |
with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as demo:
|
| 210 |
gr.Markdown("# Denetçi Görüşü Tahmin Uygulaması")
|
| 211 |
|
| 212 |
+
# 1️ Üst: Dosya yükle ve buton
|
| 213 |
with gr.Row():
|
| 214 |
+
file_in = gr.File(
|
| 215 |
+
file_types=[".xlsx", ".xls", ".xlsm"],
|
| 216 |
+
label="Excel Yükleyin"
|
| 217 |
+
)
|
| 218 |
+
btn = gr.Button("Tahmin Et", variant="primary")
|
| 219 |
|
| 220 |
+
# 2️ Örnek Excel dosyaları
|
| 221 |
gr.Examples(
|
| 222 |
examples=EXAMPLE_XLSX,
|
| 223 |
inputs=file_in,
|
| 224 |
+
label="💾 Örnek Dosyayı Deneyin",
|
| 225 |
cache_examples=False,
|
| 226 |
)
|
| 227 |
|
| 228 |
+
# 3️ Sonuçlar tablosu (sayfalama olmadan)
|
| 229 |
+
out_df = gr.Dataframe(
|
| 230 |
+
wrap=True,
|
| 231 |
+
show_label=False,
|
| 232 |
+
row_count="fixed", # 🔥 Sayfalama çubuğu kalkar
|
| 233 |
+
visible=True
|
| 234 |
+
)
|
| 235 |
+
|
| 236 |
+
# 4️ Tahmin fonksiyonu bağla
|
| 237 |
+
btn.click(predict_opinion, inputs=file_in, outputs=out_df)
|
| 238 |
|
| 239 |
if __name__ == "__main__":
|
| 240 |
demo.launch()
|