Commit
·
e14f64b
1
Parent(s):
4e48e99
add auth
Browse files
app.py
CHANGED
|
@@ -79,14 +79,30 @@ def get_text_response(user_message, history):
|
|
| 79 |
# Access the content of the AIMessage directly
|
| 80 |
return str(response.content)
|
| 81 |
|
| 82 |
-
# Create the Gradio interface
|
| 83 |
-
demo = gr.ChatInterface(fn=get_text_response, type='messages', theme="allenai/gradio-theme")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
if __name__ == "__main__":
|
| 86 |
-
demo
|
| 87 |
-
|
| 88 |
share=True,
|
|
|
|
| 89 |
#auth=(USERNAME, PASSWORD),
|
| 90 |
#auth_message="Enter the username and password provided by your instructor."
|
| 91 |
)
|
| 92 |
-
|
|
|
|
| 79 |
# Access the content of the AIMessage directly
|
| 80 |
return str(response.content)
|
| 81 |
|
| 82 |
+
# # Create the Gradio interface
|
| 83 |
+
# demo = gr.ChatInterface(fn=get_text_response, type='messages', theme="allenai/gradio-theme")
|
| 84 |
+
|
| 85 |
+
# if __name__ == "__main__":
|
| 86 |
+
# demo.launch(
|
| 87 |
+
# debug=True,
|
| 88 |
+
# share=True,
|
| 89 |
+
# #auth=(USERNAME, PASSWORD),
|
| 90 |
+
# #auth_message="Enter the username and password provided by your instructor."
|
| 91 |
+
# )
|
| 92 |
+
def create_demo():
|
| 93 |
+
# Create the chat interface
|
| 94 |
+
demo = gr.ChatInterface(
|
| 95 |
+
fn=get_text_response,
|
| 96 |
+
type='messages',
|
| 97 |
+
theme="allenai/gradio-theme"
|
| 98 |
+
)
|
| 99 |
+
return demo
|
| 100 |
|
| 101 |
if __name__ == "__main__":
|
| 102 |
+
demo = create_demo()
|
| 103 |
+
demo.queue().launch(
|
| 104 |
share=True,
|
| 105 |
+
debug=True,
|
| 106 |
#auth=(USERNAME, PASSWORD),
|
| 107 |
#auth_message="Enter the username and password provided by your instructor."
|
| 108 |
)
|
|
|