Morris
commited on
Commit
·
33be775
1
Parent(s):
f37662d
update app.py
Browse files
app.py
CHANGED
@@ -4,24 +4,25 @@ from PIL import Image
|
|
4 |
from transformers import pipeline, AutoTokenizer
|
5 |
from datasets import load_dataset, Dataset
|
6 |
import os
|
7 |
-
|
8 |
|
9 |
-
|
|
|
|
|
10 |
|
11 |
-
pipe = pipeline('text-classification', model='tiedaar/short-answer-classification')
|
12 |
-
bleurt_pipe = pipeline('text-classification', model="vaiibhavgupta/finetuned-bleurt-large")
|
13 |
-
tokenizer = AutoTokenizer.from_pretrained("vaiibhavgupta/finetuned-bleurt-large")
|
14 |
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
-
|
19 |
|
|
|
20 |
if text:
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
|
26 |
|
27 |
# def reset():
|
|
|
4 |
from transformers import pipeline, AutoTokenizer
|
5 |
from datasets import load_dataset, Dataset
|
6 |
import os
|
7 |
+
from supabase import create_client, Client
|
8 |
|
9 |
+
url: str = os.environ.get("SUPABASE_URL")
|
10 |
+
key: str = os.environ.get("SUPABASE_KEY")
|
11 |
+
supabase: Client = create_client(url, key)
|
12 |
|
|
|
|
|
|
|
13 |
|
14 |
+
# pipe = pipeline('text-classification', model='tiedaar/short-answer-classification')
|
15 |
+
# bleurt_pipe = pipeline('text-classification', model="vaiibhavgupta/finetuned-bleurt-large")
|
16 |
+
# tokenizer = AutoTokenizer.from_pretrained("vaiibhavgupta/finetuned-bleurt-large")
|
17 |
|
18 |
+
# subsections = pd.read_csv('tp-subsections.csv').dropna(axis=0, how='any', subset=['question'])
|
19 |
|
20 |
+
text = st.text_input("Write your answer here")
|
21 |
if text:
|
22 |
+
data, count = supabase.table('automatic-short-answer-scoring') \
|
23 |
+
.insert({"subsection": 1, "question": "Denmark", "answer":text}).execute()
|
24 |
+
|
25 |
+
|
26 |
|
27 |
|
28 |
# def reset():
|