Commit
·
4e48e99
1
Parent(s):
bbcd4a5
commented out auth
Browse files
app.py
CHANGED
|
@@ -15,6 +15,10 @@ from config import SYSTEM_INSTRUCTION, TEMPERATURE, MAX_TOKENS
|
|
| 15 |
load_dotenv()
|
| 16 |
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# In-memory implementation of chat message history
|
| 19 |
class InMemoryHistory(BaseChatMessageHistory, BaseModel):
|
| 20 |
"""In-memory implementation of chat message history."""
|
|
@@ -79,4 +83,10 @@ def get_text_response(user_message, history):
|
|
| 79 |
demo = gr.ChatInterface(fn=get_text_response, type='messages', theme="allenai/gradio-theme")
|
| 80 |
|
| 81 |
if __name__ == "__main__":
|
| 82 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
load_dotenv()
|
| 16 |
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
|
| 17 |
|
| 18 |
+
# Get the username and password from environment variables
|
| 19 |
+
USERNAME = os.getenv('USERNAME')
|
| 20 |
+
PASSWORD = os.getenv('PASSWORD')
|
| 21 |
+
|
| 22 |
# In-memory implementation of chat message history
|
| 23 |
class InMemoryHistory(BaseChatMessageHistory, BaseModel):
|
| 24 |
"""In-memory implementation of chat message history."""
|
|
|
|
| 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 |
+
|