Spaces:
Sleeping
Sleeping
Commit
•
f0d74e9
1
Parent(s):
7296ce7
Update app.py
Browse files
app.py
CHANGED
@@ -34,10 +34,7 @@ import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
|
|
34 |
# Input data files are available in the read-only "../input/" directory
|
35 |
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
|
36 |
|
37 |
-
|
38 |
-
for dirname, _, filenames in os.walk('/kaggle/input'):
|
39 |
-
for filename in filenames:
|
40 |
-
print(os.path.join(dirname, filename))
|
41 |
|
42 |
# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All"
|
43 |
# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session
|
@@ -69,7 +66,7 @@ import gc
|
|
69 |
import os
|
70 |
|
71 |
config = {
|
72 |
-
'model': '/
|
73 |
'dropout': 0.2,
|
74 |
'max_length': 512,
|
75 |
'batch_size':3,
|
@@ -84,7 +81,7 @@ Comparing two essays. <br>
|
|
84 |
One predicted written by students, one predicted written by LLM
|
85 |
"""
|
86 |
|
87 |
-
train_essays = pd.read_csv("
|
88 |
|
89 |
|
90 |
import transformers
|
@@ -141,7 +138,7 @@ class MeanPooling(nn.Module):
|
|
141 |
return mean_embedding
|
142 |
|
143 |
model = mymodel(config).to(device=config['device'])
|
144 |
-
model.load_state_dict(torch.load('/
|
145 |
model.eval()
|
146 |
|
147 |
#preds = []
|
@@ -184,7 +181,7 @@ def trial(text):
|
|
184 |
else:
|
185 |
return "Student"
|
186 |
|
187 |
-
|
188 |
|
189 |
import gradio as gr
|
190 |
|
|
|
34 |
# Input data files are available in the read-only "../input/" directory
|
35 |
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
|
36 |
|
37 |
+
|
|
|
|
|
|
|
38 |
|
39 |
# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All"
|
40 |
# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session
|
|
|
66 |
import os
|
67 |
|
68 |
config = {
|
69 |
+
'model': 'kaitehtzeng/primary_app/microsoft/deberta-v3-base',
|
70 |
'dropout': 0.2,
|
71 |
'max_length': 512,
|
72 |
'batch_size':3,
|
|
|
81 |
One predicted written by students, one predicted written by LLM
|
82 |
"""
|
83 |
|
84 |
+
train_essays = pd.read_csv("kaitehtzeng/primary_app/train_essays.csv")
|
85 |
|
86 |
|
87 |
import transformers
|
|
|
138 |
return mean_embedding
|
139 |
|
140 |
model = mymodel(config).to(device=config['device'])
|
141 |
+
model.load_state_dict(torch.load('kaitehtzeng/primary_app/my_model.pth'))
|
142 |
model.eval()
|
143 |
|
144 |
#preds = []
|
|
|
181 |
else:
|
182 |
return "Student"
|
183 |
|
184 |
+
pip install -q gradio==3.45.0
|
185 |
|
186 |
import gradio as gr
|
187 |
|