Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 43 |
def predict_prompt(input, user_id): # This function creates a response for the chatbot to respond with.
|
| 44 |
user_dictionary[user_id].append({"role": "user", "content": input}) # This adds the input from the user and saves it to the history before we do anything else.
|
| 45 |
|
| 46 |
-
time.sleep(
|
| 47 |
|
| 48 |
create_prompt = openai.ChatCompletion.create( #A sking openai for a prompt based on the current message history.
|
| 49 |
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).
|
|
|
|
| 43 |
def predict_prompt(input, user_id): # This function creates a response for the chatbot to respond with.
|
| 44 |
user_dictionary[user_id].append({"role": "user", "content": input}) # This adds the input from the user and saves it to the history before we do anything else.
|
| 45 |
|
| 46 |
+
time.sleep(5) # This pauses the function for the alloted amount of time (ex: time.sleep(5) -> pause for 5 seconds) *this doesnt account for the time it takes for the bot to create a response, so the bots overall response time will be noticably higher than the amount of time you put in*
|
| 47 |
|
| 48 |
create_prompt = openai.ChatCompletion.create( #A sking openai for a prompt based on the current message history.
|
| 49 |
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).
|