jozzy commited on
Commit
6d71514
·
1 Parent(s): eea00fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -3,6 +3,8 @@ import gradio as gr
3
  import openai
4
  openai.api_key = os.environ['OPENAI_API_KEY']
5
 
 
 
6
  messages = [{"role": "system", "content": 'You are a helpful technology assistant.'}]
7
 
8
  def audioGPT(audio):
@@ -54,5 +56,6 @@ audio = gr.Interface(fn=audioGPT, inputs=gr.Audio(source="microphone", type="fil
54
  demo = gr.TabbedInterface([text, audio], [ "chatGPT", "audioGPT"])
55
 
56
  if __name__ == "__main__":
57
- demo.launch(auth=("os.environ['username']", "os.environ['password']"))
 
58
  #demo.launch()
 
3
  import openai
4
  openai.api_key = os.environ['OPENAI_API_KEY']
5
 
6
+ user_db = {"os.environ['username']": "os.environ['password']"}
7
+
8
  messages = [{"role": "system", "content": 'You are a helpful technology assistant.'}]
9
 
10
  def audioGPT(audio):
 
56
  demo = gr.TabbedInterface([text, audio], [ "chatGPT", "audioGPT"])
57
 
58
  if __name__ == "__main__":
59
+ demo.launch(auth=lambda u, p: user_db.get(u) == p,
60
+ auth_message="Welcome to Yichuan GPT!")
61
  #demo.launch()