Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ import pandas as pd
|
|
| 3 |
from openai import OpenAI
|
| 4 |
import os
|
| 5 |
import json
|
| 6 |
-
import pypdf
|
| 7 |
import subprocess
|
| 8 |
TOKEN=os.getenv('HF_TOKEN')
|
| 9 |
subprocess.run(["huggingface-cli", "login", "--token", TOKEN, "--add-to-git-credential"])
|
|
@@ -87,8 +86,8 @@ ta_proposal = read_pdf(file_path)
|
|
| 87 |
file_path = "data/capy_proposal.pdf"
|
| 88 |
capy_proposal = read_pdf(file_path)
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
|
| 93 |
# Function to grade the essay using GPT-4
|
| 94 |
def grade_essay(input):
|
|
@@ -176,8 +175,8 @@ def main():
|
|
| 176 |
|
| 177 |
|
| 178 |
# File uploader for new essays to be graded (DOCX)
|
| 179 |
-
pdf_file = st.file_uploader("Upload proposal to be graded", type=["pdf"], accept_multiple_files=False)
|
| 180 |
-
new_file = read_pdf(
|
| 181 |
# Grading button
|
| 182 |
if st.button("Grade Proposal"):
|
| 183 |
if new_file:
|
|
|
|
| 3 |
from openai import OpenAI
|
| 4 |
import os
|
| 5 |
import json
|
|
|
|
| 6 |
import subprocess
|
| 7 |
TOKEN=os.getenv('HF_TOKEN')
|
| 8 |
subprocess.run(["huggingface-cli", "login", "--token", TOKEN, "--add-to-git-credential"])
|
|
|
|
| 86 |
file_path = "data/capy_proposal.pdf"
|
| 87 |
capy_proposal = read_pdf(file_path)
|
| 88 |
|
| 89 |
+
file_path = "data/Mầm Non Bong Bóng đẹp trai quá đê - Trâm Đỗ.pdf"
|
| 90 |
+
input = read_pdf(file_path)
|
| 91 |
|
| 92 |
# Function to grade the essay using GPT-4
|
| 93 |
def grade_essay(input):
|
|
|
|
| 175 |
|
| 176 |
|
| 177 |
# File uploader for new essays to be graded (DOCX)
|
| 178 |
+
# pdf_file = st.file_uploader("Upload proposal to be graded", type=["pdf"], accept_multiple_files=False)
|
| 179 |
+
new_file = read_pdf(input)
|
| 180 |
# Grading button
|
| 181 |
if st.button("Grade Proposal"):
|
| 182 |
if new_file:
|