Spaces:
Running
Running
Sean Hamill
commited on
Commit
·
3a48be9
1
Parent(s):
7aa33b9
multi-user fix
Browse files
app.py
CHANGED
@@ -56,7 +56,9 @@ def pdf_to_text(file_obj, progress=gr.Progress()):
|
|
56 |
f.close()
|
57 |
progress(0.9, desc="Azure OpenAI Magic...")
|
58 |
#save the result.content in a text file
|
59 |
-
|
|
|
|
|
60 |
f.write(str(result.content))
|
61 |
f.close()
|
62 |
# create_index()
|
@@ -66,7 +68,7 @@ def pdf_to_text(file_obj, progress=gr.Progress()):
|
|
66 |
|
67 |
chat = ChatWrapper()
|
68 |
|
69 |
-
with gr.Blocks(css="footer {visibility: hidden;}") as demo:
|
70 |
chat_history_state = gr.State()
|
71 |
pdf_content = gr.State()
|
72 |
|
|
|
56 |
f.close()
|
57 |
progress(0.9, desc="Azure OpenAI Magic...")
|
58 |
#save the result.content in a text file
|
59 |
+
# generate random string
|
60 |
+
import random
|
61 |
+
with open("data/" + ''.join(random.choices(string.ascii_uppercase + string.digits, k = 10)) + ".txt", "w") as f:
|
62 |
f.write(str(result.content))
|
63 |
f.close()
|
64 |
# create_index()
|
|
|
68 |
|
69 |
chat = ChatWrapper()
|
70 |
|
71 |
+
with gr.Blocks(css="footer {visibility: hidden;}", theme="grass") as demo:
|
72 |
chat_history_state = gr.State()
|
73 |
pdf_content = gr.State()
|
74 |
|