Spaces:
Running
Running
raj-tomar001
commited on
Commit
•
7109826
1
Parent(s):
96293b8
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def load_model(model_name):
|
|
16 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
17 |
return pipeline('text-classification', model=model, tokenizer=tokenizer, truncation=True, max_length=512, top_k=4)
|
18 |
|
19 |
-
classifier = load_model("./
|
20 |
|
21 |
# Load sample essays
|
22 |
with open(SAMPLE_JSON_PATH, 'r') as f:
|
@@ -62,7 +62,7 @@ def count_words_detection_tab(text):
|
|
62 |
|
63 |
def generate_text_challenge_tab():
|
64 |
global index
|
65 |
-
|
66 |
mg = gr.Button("Machine-Generated", variant="secondary", interactive=True)
|
67 |
hw = gr.Button("Human-Written", variant="secondary", interactive=True)
|
68 |
mh = gr.Button("Machine-Humanized", variant="secondary", interactive=True)
|
@@ -115,33 +115,17 @@ css = """
|
|
115 |
body, .gradio-container {
|
116 |
font-family: Arial, sans-serif;
|
117 |
}
|
118 |
-
|
119 |
-
background-color: #1e1e1e;
|
120 |
-
border: 1px solid #333333;
|
121 |
-
color: #ffffff;
|
122 |
-
}
|
123 |
-
.gr-button:hover {
|
124 |
-
background-color: #2e2e2e;
|
125 |
-
}
|
126 |
.gr-input, .gr-textarea {
|
127 |
-
background-color: #1f2937;
|
128 |
-
border: 1px solid #333333;
|
129 |
-
color: #ffffff;
|
130 |
-
}
|
131 |
-
.gr-form {
|
132 |
-
background-color: #1f2937;
|
133 |
-
border: 1px solid #333333;
|
134 |
}
|
|
|
135 |
.class-intro {
|
136 |
-
background-color: #1f2937;
|
137 |
-
border: 1px solid #333333;
|
138 |
padding: 15px;
|
139 |
margin-bottom: 20px;
|
140 |
border-radius: 5px;
|
141 |
}
|
142 |
.class-intro h2 {
|
143 |
margin-top: 0;
|
144 |
-
color: #ffffff;
|
145 |
}
|
146 |
.class-intro p {
|
147 |
margin-bottom: 5px;
|
|
|
16 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
17 |
return pipeline('text-classification', model=model, tokenizer=tokenizer, truncation=True, max_length=512, top_k=4)
|
18 |
|
19 |
+
classifier = load_model("./fine_tuned_roberta-base")
|
20 |
|
21 |
# Load sample essays
|
22 |
with open(SAMPLE_JSON_PATH, 'r') as f:
|
|
|
62 |
|
63 |
def generate_text_challenge_tab():
|
64 |
global index
|
65 |
+
|
66 |
mg = gr.Button("Machine-Generated", variant="secondary", interactive=True)
|
67 |
hw = gr.Button("Human-Written", variant="secondary", interactive=True)
|
68 |
mh = gr.Button("Machine-Humanized", variant="secondary", interactive=True)
|
|
|
115 |
body, .gradio-container {
|
116 |
font-family: Arial, sans-serif;
|
117 |
}
|
118 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
.gr-input, .gr-textarea {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
+
|
122 |
.class-intro {
|
|
|
|
|
123 |
padding: 15px;
|
124 |
margin-bottom: 20px;
|
125 |
border-radius: 5px;
|
126 |
}
|
127 |
.class-intro h2 {
|
128 |
margin-top: 0;
|
|
|
129 |
}
|
130 |
.class-intro p {
|
131 |
margin-bottom: 5px;
|