Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ from langchain.prompts.few_shot import FewShotPromptTemplate
|
|
| 12 |
from langchain.prompts.prompt import PromptTemplate
|
| 13 |
import re
|
| 14 |
from docx import Document
|
| 15 |
-
|
| 16 |
from langchain.schema.runnable import RunnableSequence
|
| 17 |
from langchain.schema.output_parser import StrOutputParser
|
| 18 |
from langchain.prompts import ChatPromptTemplate
|
|
@@ -177,7 +177,7 @@ def main():
|
|
| 177 |
if new_file:
|
| 178 |
result = grade_essay(input = new_file)
|
| 179 |
result = result.replace("\n", "")
|
| 180 |
-
df = pd.read_json(result)
|
| 181 |
df = df.T
|
| 182 |
# Store results in session state
|
| 183 |
st.session_state.results.append({
|
|
@@ -186,7 +186,7 @@ def main():
|
|
| 186 |
|
| 187 |
# Display the grading feedback
|
| 188 |
st.write("Feedback:")
|
| 189 |
-
|
| 190 |
|
| 191 |
st.success("Hoàn thành chấm điểm.")
|
| 192 |
else:
|
|
|
|
| 12 |
from langchain.prompts.prompt import PromptTemplate
|
| 13 |
import re
|
| 14 |
from docx import Document
|
| 15 |
+
from io import StringIO
|
| 16 |
from langchain.schema.runnable import RunnableSequence
|
| 17 |
from langchain.schema.output_parser import StrOutputParser
|
| 18 |
from langchain.prompts import ChatPromptTemplate
|
|
|
|
| 177 |
if new_file:
|
| 178 |
result = grade_essay(input = new_file)
|
| 179 |
result = result.replace("\n", "")
|
| 180 |
+
df = pd.read_json(StringIO(result))
|
| 181 |
df = df.T
|
| 182 |
# Store results in session state
|
| 183 |
st.session_state.results.append({
|
|
|
|
| 186 |
|
| 187 |
# Display the grading feedback
|
| 188 |
st.write("Feedback:")
|
| 189 |
+
st.dataframe(df)
|
| 190 |
|
| 191 |
st.success("Hoàn thành chấm điểm.")
|
| 192 |
else:
|