Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import openai
|
|
| 4 |
import os
|
| 5 |
from github import Github
|
| 6 |
import uuid
|
|
|
|
| 7 |
|
| 8 |
openai.api_key = os.getenv('OPENAI_KEY') # Initializing secrets
|
| 9 |
g = Github(os.getenv('GITHUB_KEY'))
|
|
@@ -37,6 +38,8 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 37 |
def predict_prompt(input): # This function creates a response for the chatbot to respond with.
|
| 38 |
message_history.append({"role": "user", "content": input}) # This adds the input from the user and saves it to the history before we do anything else.
|
| 39 |
|
|
|
|
|
|
|
| 40 |
create_prompt = openai.ChatCompletion.create( #A sking openai for a prompt based on the current message history.
|
| 41 |
model = "gpt-4o", # Change the message in the qoutes to change the model. Note: it must be a recognized model by openai's api (case sensetive).
|
| 42 |
messages = message_history,
|
|
|
|
| 4 |
import os
|
| 5 |
from github import Github
|
| 6 |
import uuid
|
| 7 |
+
import time
|
| 8 |
|
| 9 |
openai.api_key = os.getenv('OPENAI_KEY') # Initializing secrets
|
| 10 |
g = Github(os.getenv('GITHUB_KEY'))
|
|
|
|
| 38 |
def predict_prompt(input): # This function creates a response for the chatbot to respond with.
|
| 39 |
message_history.append({"role": "user", "content": input}) # This adds the input from the user and saves it to the history before we do anything else.
|
| 40 |
|
| 41 |
+
time.sleep(10)
|
| 42 |
+
|
| 43 |
create_prompt = openai.ChatCompletion.create( #A sking openai for a prompt based on the current message history.
|
| 44 |
model = "gpt-4o", # Change the message in the qoutes to change the model. Note: it must be a recognized model by openai's api (case sensetive).
|
| 45 |
messages = message_history,
|