Update app.py
Browse files
app.py
CHANGED
|
@@ -29,6 +29,19 @@ user_db = {os.environ['username1']: os.environ['password1']}
|
|
| 29 |
messages = [{"role": "system", "content": 'You are a helpful assistant.'}]
|
| 30 |
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
def init_pinecone(index_name):
|
|
@@ -156,7 +169,7 @@ pinecone = gr.Interface(fn=process_file, inputs=["text", gr.inputs.File(file_cou
|
|
| 156 |
#audio = gr.Interface(fn=audioGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
|
| 157 |
#siri = gr.Interface(fn=siriGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs = "audio")
|
| 158 |
file = gr.Interface(fn=fileGPT, inputs=["text", "file"], outputs="text", description = "Enter prompt sentences and your PDF. e.g. lets think step by step, summarize this following text: 或者 让我们一步一步地思考,总结以下的内容:")
|
| 159 |
-
demo = gr.TabbedInterface([role, text, file, chatHistory, pinecone], [ "roleChoice", "chatGPT", "fileGPT", "ChatHistory", "Pinecone"])
|
| 160 |
|
| 161 |
if __name__ == "__main__":
|
| 162 |
demo.launch(enable_queue=False, auth=lambda u, p: user_db.get(u) == p,
|
|
|
|
| 29 |
messages = [{"role": "system", "content": 'You are a helpful assistant.'}]
|
| 30 |
|
| 31 |
|
| 32 |
+
#debug use
|
| 33 |
+
def foo(dir):
|
| 34 |
+
return [d.name for d in dir]
|
| 35 |
+
|
| 36 |
+
with gr.Blocks() as foo:
|
| 37 |
+
input = gr.File(file_count="directory")
|
| 38 |
+
files = gr.Textbox()
|
| 39 |
+
show = gr.Button(value="Show")
|
| 40 |
+
show.click(foo, input, files)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
|
| 46 |
|
| 47 |
def init_pinecone(index_name):
|
|
|
|
| 169 |
#audio = gr.Interface(fn=audioGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
|
| 170 |
#siri = gr.Interface(fn=siriGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs = "audio")
|
| 171 |
file = gr.Interface(fn=fileGPT, inputs=["text", "file"], outputs="text", description = "Enter prompt sentences and your PDF. e.g. lets think step by step, summarize this following text: 或者 让我们一步一步地思考,总结以下的内容:")
|
| 172 |
+
demo = gr.TabbedInterface([role, text, file, chatHistory, pinecone, foo], [ "roleChoice", "chatGPT", "fileGPT", "ChatHistory", "Pinecone", "foo"])
|
| 173 |
|
| 174 |
if __name__ == "__main__":
|
| 175 |
demo.launch(enable_queue=False, auth=lambda u, p: user_db.get(u) == p,
|