Spaces:
Build error
Build error
Commit
·
d6d7f26
1
Parent(s):
7f36095
downloadable classification
Browse files
app.py
CHANGED
|
@@ -100,20 +100,26 @@ def main():
|
|
| 100 |
prompt_1 = auftrag_0 + auftrag_1_disz + str(Baubranchen_Disziplinen) + pdf_text
|
| 101 |
answer_1 = gpt4_new(prompt_1)
|
| 102 |
print(prompt_1)
|
|
|
|
| 103 |
st.write(answer_1)
|
| 104 |
with st.spinner("GPT4 at work"):
|
| 105 |
prompt_2 = auftrag_0 + auftrag_1_dokt + str(Dokumententypen) + pdf_text
|
| 106 |
answer_2 = gpt4_new(prompt_2)
|
| 107 |
print(prompt_2)
|
|
|
|
| 108 |
st.write(answer_2)
|
| 109 |
with st.spinner("GPT4 at work"):
|
| 110 |
prompt_3 = auftrag_0 + auftrag_1_gesch + str(ASH_Geschosse) + pdf_text
|
| 111 |
answer_3 = gpt4_new(prompt_3)
|
| 112 |
print(prompt_3)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
st.write(answer_3)
|
| 114 |
st.success("work done, saved")
|
| 115 |
|
| 116 |
-
st.download_button("download txt")
|
| 117 |
#st.download_button("download txt", json_open("gpt4_responses.txt"), file_name="gpt4_responses.txt")
|
| 118 |
else:
|
| 119 |
st.warning("no file")
|
|
|
|
| 100 |
prompt_1 = auftrag_0 + auftrag_1_disz + str(Baubranchen_Disziplinen) + pdf_text
|
| 101 |
answer_1 = gpt4_new(prompt_1)
|
| 102 |
print(prompt_1)
|
| 103 |
+
|
| 104 |
st.write(answer_1)
|
| 105 |
with st.spinner("GPT4 at work"):
|
| 106 |
prompt_2 = auftrag_0 + auftrag_1_dokt + str(Dokumententypen) + pdf_text
|
| 107 |
answer_2 = gpt4_new(prompt_2)
|
| 108 |
print(prompt_2)
|
| 109 |
+
|
| 110 |
st.write(answer_2)
|
| 111 |
with st.spinner("GPT4 at work"):
|
| 112 |
prompt_3 = auftrag_0 + auftrag_1_gesch + str(ASH_Geschosse) + pdf_text
|
| 113 |
answer_3 = gpt4_new(prompt_3)
|
| 114 |
print(prompt_3)
|
| 115 |
+
with open('gpt4_responses.txt', 'w', encoding='utf-8') as file:
|
| 116 |
+
file.writelines(answer_1)
|
| 117 |
+
file.writelines(answer_2)
|
| 118 |
+
file.writelines(answer_3)
|
| 119 |
st.write(answer_3)
|
| 120 |
st.success("work done, saved")
|
| 121 |
|
| 122 |
+
st.download_button("download txt", json_open("gpt4_responses.txt"), file_name="classification.txt")
|
| 123 |
#st.download_button("download txt", json_open("gpt4_responses.txt"), file_name="gpt4_responses.txt")
|
| 124 |
else:
|
| 125 |
st.warning("no file")
|