jozzy commited on
Commit
7fe1405
1 Parent(s): bea7fe3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -19
app.py CHANGED
@@ -29,24 +29,6 @@ user_db = {os.environ['username1']: os.environ['password1']}
29
  messages = [{"role": "system", "content": 'You are a helpful assistant.'}]
30
 
31
 
32
- #debug use
33
- def foo(dir):
34
- ret = []
35
- for filename in os.listdir(dir.name):
36
- ret.append(filename)
37
- return ret
38
-
39
- # debug use
40
- with gr.Blocks() as foo:
41
- filein = gr.File(file_count="directory")
42
- show_out = gr.Textbox()
43
- show = gr.Button(value="Show")
44
- show.click(fn=foo, inputs=filein, outputs=show_out, queue=False)
45
-
46
-
47
-
48
-
49
-
50
 
51
 
52
 
@@ -179,7 +161,7 @@ pinecone = gr.Interface(fn=process_file, inputs=["text", gr.inputs.File(file_cou
179
  #audio = gr.Interface(fn=audioGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
180
  #siri = gr.Interface(fn=siriGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs = "audio")
181
  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: 或者 让我们一步一步地思考,总结以下的内容:")
182
- demo = gr.TabbedInterface([role, text, file, chatHistory, pinecone, foo], [ "roleChoice", "chatGPT", "fileGPT", "ChatHistory", "Pinecone", "foo"])
183
 
184
  if __name__ == "__main__":
185
  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
 
33
 
34
 
 
161
  #audio = gr.Interface(fn=audioGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
162
  #siri = gr.Interface(fn=siriGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs = "audio")
163
  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: 或者 让我们一步一步地思考,总结以下的内容:")
164
+ demo = gr.TabbedInterface([role, text, file, chatHistory, pinecone], [ "roleChoice", "chatGPT", "fileGPT", "ChatHistory", "Pinecone"])
165
 
166
  if __name__ == "__main__":
167
  demo.launch(enable_queue=False, auth=lambda u, p: user_db.get(u) == p,