Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
# Modeli yükle
|
@@ -11,8 +12,8 @@ def answer_question(file, question):
|
|
11 |
if file is None:
|
12 |
return "Lütfen önce bir CSV dosyası yükleyin."
|
13 |
|
14 |
-
# Dosyayı aç ve CSV olarak yükle
|
15 |
-
df = pd.read_csv(file.name, encoding='ISO-8859-1'
|
16 |
|
17 |
# CSV verisini metne dönüştür
|
18 |
context = df.to_string(index=False)
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
+
import csv
|
4 |
from transformers import pipeline
|
5 |
|
6 |
# Modeli yükle
|
|
|
12 |
if file is None:
|
13 |
return "Lütfen önce bir CSV dosyası yükleyin."
|
14 |
|
15 |
+
# Dosyayı aç ve CSV olarak yükle
|
16 |
+
df = pd.read_csv(file.name, encoding='ISO-8859-1', sep=';', error_bad_lines=False, quoting=csv.QUOTE_NONE)
|
17 |
|
18 |
# CSV verisini metne dönüştür
|
19 |
context = df.to_string(index=False)
|