Kimty commited on
Commit
1e5ecc5
·
1 Parent(s): 9a9279b

feat: add authentication for Gradio app launch

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,8 +1,13 @@
 
 
1
  import gradio as gr
2
  from core import RAG, parse_cas_input
3
 
4
  rag = RAG()
5
 
 
 
 
6
  EXAMPLE_INPUTS = [
7
  "7664-39-3",
8
  "7664-39-3, 128-37-0",
@@ -122,4 +127,4 @@ with gr.Blocks(
122
  )
123
 
124
  if __name__ == "__main__":
125
- demo.launch()
 
1
+ import os
2
+
3
  import gradio as gr
4
  from core import RAG, parse_cas_input
5
 
6
  rag = RAG()
7
 
8
+ DEMO_USER = os.getenv("USERNAME", "demo")
9
+ DEMO_PASS = os.getenv("PASSWORD", "chemical2026")
10
+
11
  EXAMPLE_INPUTS = [
12
  "7664-39-3",
13
  "7664-39-3, 128-37-0",
 
127
  )
128
 
129
  if __name__ == "__main__":
130
+ demo.launch(auth=(DEMO_USER, DEMO_PASS))