Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ import openai
|
|
| 9 |
from dotenv import load_dotenv
|
| 10 |
import os
|
| 11 |
|
|
|
|
| 12 |
load_dotenv() # load environment variables from .env file
|
| 13 |
api_key = os.getenv("OPENAI_API_KEY") # access the value of the OPENAI_API_KEY environment variable
|
| 14 |
|
|
@@ -40,4 +41,19 @@ examples = [
|
|
| 40 |
["Is my personal information and data safe when I use the ChatSherman chatbot?", []],
|
| 41 |
["What are some common applications of deep learning in engineering?", []]
|
| 42 |
]
|
| 43 |
-
gr.ChatInterface(predict, title=title, description=description, examples=examples).queue().launch(debug=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
from dotenv import load_dotenv
|
| 10 |
import os
|
| 11 |
|
| 12 |
+
'''
|
| 13 |
load_dotenv() # load environment variables from .env file
|
| 14 |
api_key = os.getenv("OPENAI_API_KEY") # access the value of the OPENAI_API_KEY environment variable
|
| 15 |
|
|
|
|
| 41 |
["Is my personal information and data safe when I use the ChatSherman chatbot?", []],
|
| 42 |
["What are some common applications of deep learning in engineering?", []]
|
| 43 |
]
|
| 44 |
+
gr.ChatInterface(predict, title=title, description=description, examples=examples).queue().launch(debug=True)
|
| 45 |
+
'''
|
| 46 |
+
|
| 47 |
+
title = "ChatSherman-2.0"
|
| 48 |
+
description = ("Due to the unavailability of an OpenAI key, this chatbot is currently not operational. "
|
| 49 |
+
"I apologize for any inconvenience caused. However, you may try using ChatSherman-1.0 at "
|
| 50 |
+
"https://huggingface.co/spaces/ShermanAI/ChatSherman for a similar conversational experience. "
|
| 51 |
+
"Thank you for your understanding")
|
| 52 |
+
|
| 53 |
+
def show_message():
|
| 54 |
+
return description # Simply return the message.
|
| 55 |
+
|
| 56 |
+
# Create a Gradio interface that only shows the message with no interaction.
|
| 57 |
+
iface = gr.Interface(fn=show_message, inputs=[], outputs="text", title=title, description=description)
|
| 58 |
+
|
| 59 |
+
iface.launch(debug=True)
|