Spaces:
Running
Running
Commit
·
21bcf26
1
Parent(s):
a628692
build chain
Browse files
app.py
CHANGED
|
@@ -81,13 +81,24 @@ def main():
|
|
| 81 |
if st.button("classify KBOB!"):
|
| 82 |
if uploaded_file is not None:
|
| 83 |
with st.spinner("GPT4 at work"):
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
st.success("work done, saved")
|
| 89 |
-
|
| 90 |
-
st.download_button("download txt", json_open("gpt4_responses.txt"), file_name="gpt4_responses.txt")
|
| 91 |
else:
|
| 92 |
st.warning("no file")
|
| 93 |
|
|
@@ -96,9 +107,11 @@ if __name__ == "__main__":
|
|
| 96 |
#prompts = ["classify the document, tell me the ", "hello"]
|
| 97 |
#process_prompts_and_save(prompts)
|
| 98 |
auftrag_1a = "Klassifiziere dieses Dokument nach "
|
|
|
|
|
|
|
| 99 |
Baubranchen_Disziplinen = ['Lüftung', 'Heizung', 'Sanitär', 'Elektro', 'Architektur', 'Statik']
|
| 100 |
-
|
| 101 |
Dokumententypen = ['Fotodokumentation', 'Projektdokumentation (PD)', 'Objektdokumentation (OD)',
|
| 102 |
'Prozessdokumentation', 'Fachdokumentation', 'Anlagedokumentation']
|
| 103 |
-
|
| 104 |
main()
|
|
|
|
| 81 |
if st.button("classify KBOB!"):
|
| 82 |
if uploaded_file is not None:
|
| 83 |
with st.spinner("GPT4 at work"):
|
| 84 |
+
pdf_text = str(get_pdf_text(uploaded_file))
|
| 85 |
+
prompt_1 = auftrag_1a + auftrag_1b + str(Baubranchen_Disziplinen) + pdf_text
|
| 86 |
+
answer_1 = gpt4_new(prompt_1)
|
| 87 |
+
print(prompt_1)
|
| 88 |
+
st.write(answer_1)
|
| 89 |
+
with st.spinner("GPT4 at work"):
|
| 90 |
+
prompt_2 = auftrag_1a + auftrag_1c + str(Dokumententypen) + pdf_text
|
| 91 |
+
answer_2 = gpt4_new(prompt_2)
|
| 92 |
+
print(prompt_2)
|
| 93 |
+
st.write(answer_2)
|
| 94 |
+
|
| 95 |
+
#with st.spinner("GPT4 at work"):
|
| 96 |
+
#prompt_3 =
|
| 97 |
+
#answer_3 =
|
| 98 |
+
#print(prompt_2)
|
| 99 |
st.success("work done, saved")
|
| 100 |
+
|
| 101 |
+
#st.download_button("download txt", json_open("gpt4_responses.txt"), file_name="gpt4_responses.txt")
|
| 102 |
else:
|
| 103 |
st.warning("no file")
|
| 104 |
|
|
|
|
| 107 |
#prompts = ["classify the document, tell me the ", "hello"]
|
| 108 |
#process_prompts_and_save(prompts)
|
| 109 |
auftrag_1a = "Klassifiziere dieses Dokument nach "
|
| 110 |
+
auftrag_1b = "diesen 'Baubranchen Disziplinen': "
|
| 111 |
+
auftrag_1c = "diesen 'Dokumententypen': "
|
| 112 |
Baubranchen_Disziplinen = ['Lüftung', 'Heizung', 'Sanitär', 'Elektro', 'Architektur', 'Statik']
|
| 113 |
+
auftrag_2 = "gib nur den am besten passendsten Eintrag zurück. Dokumenteninhalt: "
|
| 114 |
Dokumententypen = ['Fotodokumentation', 'Projektdokumentation (PD)', 'Objektdokumentation (OD)',
|
| 115 |
'Prozessdokumentation', 'Fachdokumentation', 'Anlagedokumentation']
|
| 116 |
+
#print(str(Baubranchen_Disziplinen))
|
| 117 |
main()
|