xjlulu commited on
Commit
df0a00c
1 Parent(s): a584a85
Files changed (2) hide show
  1. README.md +2 -1
  2. app.py +3 -7
README.md CHANGED
@@ -30,4 +30,5 @@ Before running the application, make sure you have Python and the required packa
30
  You can install the necessary Python packages using `pip`:
31
 
32
  ```shell
33
- pip install transformers gradio datasets
 
 
30
  You can install the necessary Python packages using `pip`:
31
 
32
  ```shell
33
+ pip install transformers gradio datasets
34
+ ```
app.py CHANGED
@@ -5,7 +5,6 @@ from gradio.components import Textbox
5
  import csv
6
  import ast
7
 
8
- import ipdb
9
 
10
  examples = []
11
 
@@ -15,12 +14,9 @@ with open('Preprocess_validation.csv', mode='r') as csv_file:
15
 
16
  # 读取前五行数据
17
  for i, row in enumerate(csv_reader):
18
- if i >= 5:
19
- break
20
- if i > 0:
21
- row_q = ast.literal_eval(row[4])['text'][0]
22
- row_c = row[10]
23
- examples.append([row_q, row_c])
24
 
25
  inputs = [
26
  Textbox(lines=3, label="Question"),
 
5
  import csv
6
  import ast
7
 
 
8
 
9
  examples = []
10
 
 
14
 
15
  # 读取前五行数据
16
  for i, row in enumerate(csv_reader):
17
+ row_q = ast.literal_eval(row[4])['text'][0]
18
+ row_c = row[10]
19
+ examples.append([row_q, row_c])
 
 
 
20
 
21
  inputs = [
22
  Textbox(lines=3, label="Question"),